On Mon, Aug 9, 2010 at 1:19 PM, John Lato <[email protected]> wrote:
> I don't find purify2 particularly helpful because I almost never want
> to break out of any arbitrary monad; I want to be able to break out of
> a specific monad without knowing which monad it is, that is:
>
> purify3 :: Monad m => m a -> a
> purify3 = undefined  --the only possible definition...
>
> However, I just realized that something else is almost as good:
>
> evalCont :: Cont r a -> r
> evalCont k = runCont k id

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?

Luke
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to