
14 Mar
2007
14 Mar
'07
10:58 a.m.
I can't seem to find any examples of how to actually implement liftIO for a monad. Any ideas/pointers?
Searching the haskell wiki for MonadIO gives several examples. http://haskell.org/haskellwiki/New_monads/MonadExit
instance MonadIO m => MonadIO (ExitT e m) where liftIO = lift . liftIO
Where you can see you are just delegating the work of the transformer to the underlying monad. Eventually it hits the bottom of the stack and sees:
instance MonadIO IO where liftIO = id