
21 Nov
2011
21 Nov
'11
4:24 p.m.
2011/11/21 David Menendez
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