Proposal: merge either into transformers

Ross Paterson R.Paterson at city.ac.uk
Sat Apr 26 23:51:40 UTC 2014


On Sat, Apr 26, 2014 at 11:29:01PM +0300, Roman Cheplyaka wrote:
> I don't understand the issue here. Why does it have to be abstract or
> based on StateT?
> 
> We could simply make a new module with the same WriterT type and the instance
> 
>   instance (Monoid w, Monad m) => Monad (WriterT w m) where
>     m >>= k  = WriterT $ do
>       (a, w)  <- runWriterT m
>       (b, w') <- runWriterT (k a)
>       let w'' = w `mappend` w'
>       w'' `seq` return (b, w'')

See Gabriel's analysis:

http://www.haskell.org/pipermail/libraries/2013-March/019528.html

The above is version #2 there.


More information about the Libraries mailing list