different flavours of Monad Transformer Library

Henning Thielemann lemming at henning-thielemann.de
Mon Jan 5 07:06:37 EST 2009


On Mon, 5 Jan 2009, Ross Paterson wrote:

> On Mon, Jan 05, 2009 at 09:32:21AM +0100, Henning Thielemann wrote:
>
>> I also like to have a function 'state', which replaces the former 'State'
>> constructor. I can also submit a patch if you want that.
>
> You mean
>
> 	state :: (s -> (a, s)) -> State s a
> 	state f = StateT (Identity . f)
>
> and similarly for all the others?  Sounds reasonable.

You have already added them, thanks! Maybe you can even add 'stateT' and 
the likes in order to give programmers a way of staying independent from 
the particular definition of StateT.


More information about the Libraries mailing list