[Haskell-cafe] Re: do

Ryan Ingram ryani.spam at gmail.com
Mon Oct 15 20:59:39 EDT 2007


On 10/15/07, ChrisK <haskell at list.mightyreason.com> wrote:
> Also you need to get you hand on State# RealWorld either
>  (1) Honestly, by wrapping your code in IO again and using it normally
>  (2) From a copy, via unsafeInterleaveIO
>  (3) From nowhere, via unsafePerformIO

Or you can get it honestly via lifting:

liftRawIO :: (State# RealWorld -> (# State# RealWorld, a #)) -> IO a
liftRawIO = GHC.IOBase.IO

main = liftRawIO rawMain

rawMain :: State# RealWorld-> (# State# RealWorld, () #)
{- implement rawMain here -}

  -- ryan


More information about the Haskell-Cafe mailing list