On Thu, 2008-04-10 at 11:53 -0700, Adam Smyczek wrote:
Thanks a lot for all explanations!
It looks like 'ioAction' is the key to the solution
and if the Browser module did not provide/expose
this function, no IO actions could be run inside
the BrowserAction monad?
If yes, is this a
On 4/10/08, Adam Smyczek [EMAIL PROTECTED] wrote:
If yes, is this a general concept/pattern
how to hide functionality of a underlying monad,
in this case hide IO entirely?
Yes, that's correct, although with IO you can't hide it entirely;
eventually you need a way to actually run the
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)
Assuming you have ioAction :: IO x - BrowserAction x
(from http://homepages.paradise.net.nz/warrickg/haskell/http/#browser)
you can do:
instance MonadIO BrowserAction where liftIO = ioAction
Then you can derive MonadIO with GHC's newtype deriving.
Alternatively, you can implement it directly
On Thu, Apr 10, 2008 at 9:50 AM, Adam Smyczek [EMAIL PROTECTED] 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
On Thu, Apr 10, 2008 at 12:44 PM, Antoine Latter [EMAIL PROTECTED] wrote:
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
import Control.Monad.Trans
import Control.Monad.State
import Control.Monad.Error
type BrowserAction = IO -- or something else which is in MondaIO
data RBState =
On Thu, Apr 10, 2008 at 7:50 AM, Adam Smyczek [EMAIL PROTECTED] 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
Thanks a lot for all explanations!
It looks like 'ioAction' is the key to the solution
and if the Browser module did not provide/expose
this function, no IO actions could be run inside
the BrowserAction monad?
If yes, is this a general concept/pattern
how to hide functionality of a underlying
On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek [EMAIL PROTECTED] 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
Adam Smyczek 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,
On Apr 10, 2008, at 12:42 PM, Luke Palmer wrote:
On Thu, Apr 10, 2008 at 2:50 PM, Adam Smyczek
[EMAIL PROTECTED] 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
11 matches
Mail list logo