transformers versus mtl

Sittampalam, Ganesh ganesh.sittampalam at
Sat Mar 28 06:58:18 EDT 2009

Sittampalam, Ganesh wrote:
> Sittampalam, Ganesh wrote:
>> Ross Paterson wrote:
>>> On Sun, Mar 22, 2009 at 06:31:08AM -0000, Sittampalam, Ganesh wrote:
>>>> Essentially we have the choice of producing full compatibility by
>>>> keeping the separate type in mtl, in which case State from mtl is
>>>> not State from transformers, or partial compatibility by
>>>> re-exporting the transformers one.
>>> Yes, we must choose between full compatibility with mtl and full
>>> compatibility with transformers.  A quick implementation of the
>>> former is 
>>> The separate versions of State etc are present, but deprecated.
>> Cool. I've been been playing around with regression testing hackage
>> following Duncan's blog post on the subject - I've got a baseline
>> test running now and will try your mtl-compat out next,
> I've tried this now. Various new failures, which I don't have time to
> investigate all of tonight, but the first one I looked at is in the
> 'cgi' package, and is because the Functor instances for ReaderT r m
> and WriterT w m now (correctly) depend on Functor m, whereas in mtl
> they depend on Monad m.    

Here's the list of failures - though it doesn't cover packages that
installable on my machine for some other reason like needing gtk2hs or
a C library.

blogination-0.5        Functor instances depending on Functor,
                       instance collision Applicative/Alternative ErrorT
category-extras-0.53.5 Functor instances depending on Functor
cgi-3001.1.7.1         Functor instances depending on Functor
encoding-0.5.1         instance collision: Monad Either
logict-0.2.3           instance collision: Applicative Identity
monad-param-0.0.2      Functor instances depending on Functor
mueval-0.7.1           Functor instances depending on Functor
xcb-types-0.5.1        instance collision: Applicative/Alternative
xmonad-contrib-0.8.1   instance collision: Error [a]

and also packages that depend on the above directly or indirectly:
bff, cflp,cgi-undecidable, fastcgi, gitit, kibro, xmonad-eval

and if we go one step further and remove State etc (so they become type
synonyms, repo here: ),
the following extra failures:

FileManip-0.3.2            Missing data constructor: State
HAppS-Server-0.9.3         Missing data constructor: Reader
HaLeX-1.1.1                Missing data constructor: State
LambdaHack-0.1.20080413    Missing data constructor: State
applicative-extras-0.1.4   instance Applicative (State a) which now
                           (a) needs TypeSynonymInstances and (b)
derive-0.1.4               instance Applicative (Writer a) which now
                           (a) needs TypeSynonymInstances and (b)
lambdabot-          Missing data constructor: State
open-witness-0.1.1         Missing data constructor: State
random-fu-          instance MonadRandom (State StdGen)
                           - needs TypeSynonymInstances or rewrite with
yhccore-0.9.1              instance UniqueIdM (State a)
                           - needs TypeSynonymInstances or rewrite with

and dependencies:
FermatsLastMargin, HappSHelpers, HSHHelpers, HStringTemplateHelpers,
firstify, formlets, happstack-helpers, hugs2yc, ycextra

So, thoughts on how to proceed? Personally I would be inclined to go the
hog as there isn't that much breakage - the downside being that it'll be
for any of these packages to be compatible with both old mtl and new mtl
simultaneously, with the exception of "Functor instances depending on
which can be solved by having both Functor and Monad in the constraints.

I've started contacting the authors of the directly affected packages
asking them to add mtl<1.2 to their dependencies so that if we do go
with any change the disruption will be minimised.



 Please access the attached hyperlink for an important electronic communications disclaimer: 

More information about the Libraries mailing list