r/purescript • u/Unable_Breadfruit • Oct 22 '19
How does the continuation monad work?
https://maxhallinan.com/posts/2019/10/22/how-does-the-continuation-monad-work/
13
Upvotes
r/purescript • u/Unable_Breadfruit • Oct 22 '19
View all comments
3
u/dave4420 Oct 22 '19
No. m does not need to be a monad. m only needs to be a (covariant) functor.
Also, I think it complicates matters to jump straight to ContT. Consider data Cont r a = Cont ((a -> r) -> r) — this allows you to set r ~ m s if you want.