Why is "Cont" out of scope?

I am trying to use the Cont in Control.Monad.Cont but it seems to be missing Prelude> import Control.Monad.Cont Prelude Control.Monad.Cont> :t Cont <interactive>:1:1: Not in scope: data constructor `Cont' Perhaps you meant `ContT' (imported from Control.Monad.Cont) Prelude Control.Monad.Cont> :t runCont runCont :: Cont r a -> (a -> r) -> r Prelude Control.Monad.Cont> :t ContT ContT :: ((a -> m r) -> m r) -> ContT r m a Prelude Control.Monad.Cont> Any ideas? Thanks -- Daryoush Weblog: http://onfp.blogspot.com/

On Tue, Apr 2, 2013 at 8:37 PM, Daryoush Mehrtash
I am trying to use the Cont in Control.Monad.Cont but it seems to be missing
Prelude> import Control.Monad.Cont Prelude Control.Monad.Cont> :t Cont
It's gone; try "cont" (lowercase). mtl2 replaced the old standalone monads with monad transformers over the Identity monad (so Cont is a type alias for ContT Identity); however, it's not possible to create data constructors for type aliases, so the Cont data constructor is gone and a "cont" smart constructor has taken its place. Prelude Control.Monad.Cont> :t cont cont :: ((a -> r) -> r) -> Cont r a The same is true of State, Reader, and Writer. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
participants (2)
-
Brandon Allbery
-
Daryoush Mehrtash