Stricter WriterT (Part II)
Edward Kmett
ekmett at gmail.com
Wed Mar 20 01:33:37 CET 2013
I use them fairly heavily, mostly so I can make packages that work with
arbitrary transformer stacks.
I'd be willing to endure the pain of using #if
MIN_VERSION_transformers(x,y,z) bracketing around the use of Strict.WriterT
and Strict.RWST constructors so long as there were writerT/runWriterT and
rwsT/runRWST analogues I could simply invoke.
-Edward
On Tue, Mar 19, 2013 at 11:07 AM, Gabriel Gonzalez <gabriel439 at gmail.com>wrote:
> Presumably we'll also need
>>
>> writerT :: m (a, w) -> WriterT w m a
>>
>
> Yes, we would need that, too:
>
> writerT m = WriterT $ \w -> do
> (a, w') <- m
> let wt = mappend w w'
> wt `seq` return (a, wt)
>
>
> Is there any reason to keep Control.Monad.Trans.Writer.**Strict, or
>> should this replace it?
>>
>
> If we replace the old one, it will break existing code that used the
> `WriterT` constructor. Same thing for the strict RWST constructor if we
> similarly modify that. However, I don't know exactly how many packages use
> those constructors. I will try to do a text search of Hackage this coming
> weekend to check and see if it is feasible to ask downstream packages that
> use `WriterT`/`RWST` constructors to set upper bounds on `transformers`.
>
>
>
> ______________________________**_________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/**mailman/listinfo/libraries<http://www.haskell.org/mailman/listinfo/libraries>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130319/e8ce4911/attachment.htm>
More information about the Libraries
mailing list