new major release of transformers package

Henning Thielemann lemming at henning-thielemann.de
Thu Mar 8 12:09:35 CET 2012


On Thu, 8 Mar 2012, Ross Paterson wrote:

> * generalized constructor functions:
>
>        state :: Monad m => (s -> (a, s)) -> StateT s m a
>        reader :: Monad m => (r -> a) -> ReaderT r m a
>        writer :: Monad m => (a, w) -> WriterT w m a

I'd prefer to call them stateT, readerT, writerT in order to keep 'state', 
'reader', 'writer' with the restricted types. The restricted type should 
work without type annotations in cases where I really only want type 
'State'. Actually stateT, readerT, writerT are only alternative 
constructors for StateT, ReaderT, WriterT with a restriction on 'm'. We 
might discuss, whether (Monad m) is too restrictive or whether it should 
be only (Functor m).



More information about the Libraries mailing list