[Haskell-cafe] Re: Can we come out of a monad?

Ertugrul Soeylemez es at ertes.de
Tue Aug 10 02:31:14 EDT 2010


"Edward Z. Yang" <ezyang at MIT.EDU> wrote:

> Excerpts from Luke Palmer's message of Tue Aug 10 01:04:04 -0400 2010:
> > Except, of course, you want the signature
> >
> >   evalCont :: Cont r a -> a
> >
> > Which is not possible.  But I am not sure where all this discussion
> > is coming from, Maybe and (r ->) cannot be broken out of.  Isn't
> > that example enough?
>
> I'm confused... that's the type of evalCont, no?

There is no evalCont, there is runCont:

  runCont :: (a -> r) -> Cont r a -> r

Note that Cont/ContT computations result in a value of type 'r':

  newtype Cont r a = Cont ((a -> r) -> r)


Greets,
Ertugrul


-- 
nightmare = unsafePerformIO (getWrongWife >>= sex)
http://ertes.de/




More information about the Haskell-Cafe mailing list