Re: [Haskell-cafe] How to understand such a newtype ?

2009-11-22 Thread Cristiano Paris
On Sun, Nov 22, 2009 at 3:47 AM, Felipe Lessa felipe.le...@gmail.com wrote: ... Well, “ReaderT XConf (StateT XState IO) a” is *the* type :). It's a monad that is a Reader of XConf and has a State of XState. ... and also wraps a monad to allow IO access inside the X monad. Cristiano

[Haskell-cafe] How to understand such a newtype ?

2009-11-21 Thread zaxis
newtype X a = X (ReaderT XConf (StateT XState IO) a) #ifndef __HADDOCK__ deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf, Typeable) #endif In `X (ReaderT XConf (StateT XState IO) a)`, X is a type constructor, how to understand `(ReaderT XConf (StateT XState IO) a)` ?

Re: [Haskell-cafe] How to understand such a newtype ?

2009-11-21 Thread Felipe Lessa
On Sat, Nov 21, 2009 at 06:20:40PM -0800, zaxis wrote: newtype X a = X (ReaderT XConf (StateT XState IO) a) #ifndef __HADDOCK__ deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf, Typeable) #endif In `X (ReaderT XConf (StateT XState IO) a)`, X is a type constructor,

Re: [Haskell-cafe] How to understand such a newtype ?

2009-11-21 Thread zaxis
thanks ! Felipe Lessa wrote: On Sat, Nov 21, 2009 at 06:20:40PM -0800, zaxis wrote: newtype X a = X (ReaderT XConf (StateT XState IO) a) #ifndef __HADDOCK__ deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf, Typeable) #endif In `X (ReaderT XConf (StateT