
20 Oct
2009
20 Oct
'09
6:08 a.m.
Brent Yorgey wrote:
Note that little-r 'reader' is just an informal name for the ((->) e) monad, which is what your code was using. Control.Monad.Reader also provides the big-R 'Reader' type, which is just a newtype wrapper around a little-r reader, and does indeed have a 'runReader' method (which just removes the newtype constructor). That is,
newtype Reader r a = Reader { runReader :: r -> a }
C.M.Reader also provides ReaderT, a monad transformer version of Reader.
I thought Control.Monad.Reader also provides the needed instance Monad ((->) r) but this is actually provided by Control.Monad.Instances . Regards, apfelmus -- http://apfelmus.nfshost.com