Skip to content

Commit 70bd2c3

Browse files
authored
Merge pull request #80 from purescript/unfold-rearrange
Rearrange arguments of unfoldCofree
2 parents 5f59862 + 53767f0 commit 70bd2c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Control/Comonad/Cofree.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ hoistCofree nat cf = head cf :< nat (hoistCofree nat <$> tail cf)
6161
unfoldCofree
6262
:: forall f s a
6363
. Functor f
64-
=> s
65-
-> (s -> a)
64+
=> (s -> a)
6665
-> (s -> f s)
66+
-> s
6767
-> Cofree f a
68-
unfoldCofree s e n =
69-
Cofree (e s) (defer \_ -> map (\s1 -> unfoldCofree s1 e n) (n s))
68+
unfoldCofree e n s =
69+
Cofree (e s) (defer \_ -> unfoldCofree e n <$> n s)
7070

7171
-- | Explore a value in the cofree comonad by using an expression in a
7272
-- | corresponding free monad.

0 commit comments

Comments
 (0)