[Haskell-cafe] Fighting the monad stack, MonadIO

Adam Smyczek adam.smyczek at gmail.com
Thu Apr 10 15:51:47 EDT 2008


On Apr 10, 2008, at 12:42 PM, Luke Palmer wrote:

> On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek  
> <adam.smyczek at gmail.com> wrote:
>> For a small webapi binding I try to implement a session like monad
>>  by building a stack including BrowserAction from Network.Browser
>>  module as following:
>>
>>  newtype RBAction a = RBAction
>>     { exec :: ErrorT String (StateT RBState BrowserAction) a }
>>     deriving (Functor, Monad, MonadState RBState)
>>
>>  I would like the RBAction to implement MonadIO as well,
>>  but fight with the liftIO function for hours now, without success.
>>  Any idea how the implementation of liftIO could look like?
>
> I suspect BrowserAction does not implement MonadIO (lest you could
> just put MonadIO in the deriving clause).  So, that depends on how
> BrowserAction is implemented.  What package is Network.Browser in?

It's correct, BrowserAction does not implement MonadIO.
This are the small things that confuse beginners like me :)
Package http:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP-3001.0.4

> Luke

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080410/0193d9cd/attachment.htm


More information about the Haskell-Cafe mailing list