Daryoush Mehrtash | 3 Apr 02:37 2013
Picon

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/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Brandon Allbery | 3 Apr 04:15 2013
Picon

Re: Why is "Cont" out of scope?

On Tue, Apr 2, 2013 at 8:37 PM, Daryoush Mehrtash <dmehrtash <at> gmail.com> wrote:
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 <at> gmail.com                                  ballbery <at> sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane