Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 49baa46

Browse files
committed
🔥 iter.
1 parent 2f81268 commit 49baa46

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

semantic-core/src/Data/Term.hs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
module Data.Term
33
( Term(..)
44
, Syntax(..)
5-
, iter
65
) where
76

87
import Control.Effect.Carrier
@@ -59,18 +58,3 @@ instance Syntax (Scope ()) where
5958
instance (Syntax l, Syntax r) => Syntax (l :+: r) where
6059
foldSyntax go bound free (L l) = L (foldSyntax go bound free l)
6160
foldSyntax go bound free (R r) = R (foldSyntax go bound free r)
62-
63-
64-
iter :: forall m n sig a b
65-
. Syntax sig
66-
=> (forall a . m a -> n a)
67-
-> (forall a . sig n a -> n a)
68-
-> (forall a . Incr () (n a) -> m (Incr () (n a)))
69-
-> (a -> m b)
70-
-> Term sig a
71-
-> n b
72-
iter var alg bound = go
73-
where go :: forall x y . (x -> m y) -> Term sig x -> n y
74-
go free = \case
75-
Var a -> var (free a)
76-
Term t -> alg (foldSyntax go bound free t)

0 commit comments

Comments
 (0)