Skip to content

Commit 1a2fe6a

Browse files
hoistFree -> hoist
1 parent 0268ccc commit 1a2fe6a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Control/Monad/Free.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ roll f = Bind (unsafeCoerce f) (unsafeCoerce (Leaf \a -> a))
3535
suspend :: forall f a. Applicative f => Free f a -> Free f a
3636
suspend = roll <<< pure
3737

38-
hoistFree :: forall f g. (f ~> g) -> Free f ~> Free g
39-
hoistFree nat = case _ of
38+
hoist :: forall f g. (f ~> g) -> Free f ~> Free g
39+
hoist nat = case _ of
4040
Pure a -> Pure a
4141
Bind f k -> Bind (nat f) (Hoist (unsafeCoerce nat) (unsafeCoerce k))
4242

@@ -78,7 +78,7 @@ resume pure' bind' = case _ of
7878

7979
go2 :: forall g x y. (UnsafeBoundF ~> g) -> FreeBinds UnsafeBoundF x y -> x -> Free g y
8080
go2 nat bs x = case bs of
81-
Leaf k -> hoistFree nat (k x)
81+
Leaf k -> hoist nat (k x)
8282
Node l r -> case uncons l r of
8383
FreeCons k bs' -> case k x of
8484
Pure a -> go2 nat bs' a
@@ -97,7 +97,7 @@ uncons = go1
9797

9898
go2 :: forall g a' b' x'. (UnsafeBoundF ~> g) -> FreeBinds UnsafeBoundF a' x' -> FreeBinds g x' b' -> FreeCons g a' b'
9999
go2 nat l r = case l of
100-
Leaf k -> FreeCons (hoistFree nat <$> unsafeCoerce k) (unsafeCoerce r)
100+
Leaf k -> FreeCons (hoist nat <$> unsafeCoerce k) (unsafeCoerce r)
101101
Node l' r' -> go2 nat l' (Node (Hoist nat (unsafeCoerce r')) (unsafeCoerce r))
102102
Hoist nat' n -> go2 (nat <<< nat') n r
103103

0 commit comments

Comments
 (0)