[Haskell-cafe] Interpreter with Cont
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...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe