
24 Aug
2011
24 Aug
'11
12:54 p.m.
bob zhang
I thought the right type for ContT should be newtype ContT m a = ContT {runContT :: forall r. (a-> m r) -> m r}
No, that will effectively make it impossible to make use of CPS effects, hence turning your ContT into an IdentityT-like monad transformer, which can only change the semantics of the underlying monad. More concretely what you are implementing here is a codensity as you can find it in the monad-ran package by Edward K. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/