[Haskell-cafe] Interpreter with Cont
Tim Baumgartner
baumgartner.tim at googlemail.com
Mon Nov 21 22:24:33 CET 2011
2011/11/21 David Menendez <dave at zednenem.com>
>
> Here's how you might implement your monad using Cont,
>
> type InteractionM a b = Cont (Interaction a b)
>
> exit b = Cont $ \k -> Exit b
> output b = Cont $ \k -> Output b (k ())
> input = Cont $ \k -> Input k
> runM m = runCont m Exit
>
That's what I originally wanted to know. I guess I struggled with the
definition of output.
Oh, there's so much more to learn...
Thanks,
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111121/b4a4540e/attachment.htm>
More information about the Haskell-Cafe
mailing list