<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Apr 10, 2008, at 12:42 PM, Luke Palmer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek <<a href="mailto:adam.smyczek@gmail.com">adam.smyczek@gmail.com</a>> wrote:</div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">For a small webapi binding I try to implement a session like monad</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>by building a stack including BrowserAction from Network.Browser</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>module as following:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>newtype RBAction a = RBAction</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>{ exec :: ErrorT String (StateT RBState BrowserAction) a }</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>deriving (Functor, Monad, MonadState RBState)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>I would like the RBAction to implement MonadIO as well,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>but fight with the liftIO function for hours now, without success.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space"> </span>Any idea how the implementation of liftIO could look like?</div> </blockquote><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I suspect BrowserAction does not implement MonadIO (lest you could</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">just put MonadIO in the deriving clause).<span class="Apple-converted-space"> </span>So, that depends on how</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">BrowserAction is implemented.<span class="Apple-converted-space"> </span>What package is Network.Browser in?</div></blockquote><div><br class="webkit-block-placeholder"></div><div>It's correct, BrowserAction does not implement MonadIO.<br></div><div>This are the small things that confuse beginners like me :)</div><div>Package http:</div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP-3001.0.4">http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP-3001.0.4</a></font></div></div><div><br></div><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Luke</div> </blockquote></div><br></body></html>