
10 Apr
2008
10 Apr
'08
5:47 p.m.
On Thu, Apr 10, 2008 at 12:44 PM, Antoine Latter
{-# 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 = RBState
newtype RBAction a = RBAction { exec :: ErrorT String (StateT RBState BrowserAction) a } deriving (Functor, Monad, MonadState RBState, MonadIO)
D'oh! Deriving MonadIO for the newtype should work, so long as BrowserAction is in the MonadIO class. -Antoine