unliftM

Lars Lundgren [email protected]
Fri, 23 Feb 2001 10:19:23 +0100 (CET)


On 23 Feb 2001, Julian Assange wrote:

> 
> Is there a standard construct for something of this ilk:
> 
> unliftM :: Monad m a -> a
> 

I do not know if it is a standard, but every monad usually has a
"runMonad" function. For ST you have runST, for IO you have
unsafePerformIO and for your own monad you need to define it.

Note, that if you use unsafePerformIO you, the action must not have
(important) sideeffects. The burden of proof is upon YOU.

/Lars L