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