
Hi, I have
dom1@fourier:~/asn1_0> ghc-pkg list --user /home/dom1/.ghc/i386-linux-6.12.1/package.conf.d mtl-1.1.0.2 mtl-2.0.1.0
But I get the following error:
[4 of 6] Compiling LatticeMod ( LatticeMod.hs, interpreted ) [5 of 6] Compiling ConstraintGeneration ( ConstraintGeneration.lhs, interpreted )
ConstraintGeneration.lhs:781:6: Overlapping instances for Monad (Either String) arising from a use of `return' at ConstraintGeneration.lhs:(781,6)-(782,69) Matching instances: instance (Error e) => Monad (Either e) -- Defined in Control.Monad.Trans.Error instance (mtl-1.1.0.2:Control.Monad.Error.Class.Error e) => Monad (Either e) -- Defined in mtl-1.1.0.2:Control.Monad.Error In the expression: return (ExtensibleConstraint (ResStringConstraint v top) (ResStringConstraint top top) b) In the definition of `pvPermittedAlphabetElements': pvPermittedAlphabetElements (S (SV v)) b = return (ExtensibleConstraint (ResStringConstraint v top) (ResStringConstraint top top) b) Failed, modules loaded: ASNTYPE, LatticeMod, Language.ASN1.PER.Integer, Language.ASN1.PER.IntegerAux. If I do
dom1@fourier:~/asn1_0> ghc-pkg hide mtl-2.0.1.0
Then the error goes away. But if I do
ghc-pkg hide mtl-1.1.0.2
Then I still get the error. Is there a wiki page that tells me what to do to upgrade from mtl-1 to mtl-2? Or perhaps someone can tell me what to do? Many thanks, Dominic.

On Saturday 16 April 2011 14:41:00, Dominic Steinitz wrote:
Hi, I have
dom1@fourier:~/asn1_0> ghc-pkg list --user /home/dom1/.ghc/i386-linux-6.12.1/package.conf.d
mtl-1.1.0.2 mtl-2.0.1.0
But I get the following error:
[4 of 6] Compiling LatticeMod ( LatticeMod.hs, interpreted ) [5 of 6] Compiling ConstraintGeneration ( ConstraintGeneration.lhs, interpreted )
ConstraintGeneration.lhs:781:6: Overlapping instances for Monad (Either String) <snip> Language.ASN1.PER.Integer, Language.ASN1.PER.IntegerAux.
If I do
dom1@fourier:~/asn1_0> ghc-pkg hide mtl-2.0.1.0
Then the error goes away. But if I do
ghc-pkg hide mtl-1.1.0.2
Then I still get the error.
Some library you use was built against mtl-1, I think, so you inherit that instance.
Is there a wiki page that tells me what to do to upgrade from mtl-1 to mtl-2? Or perhaps someone can tell me what to do?
Rebuild the libraries that depend on mtl against mtl-2. $ ghc-pkg unregister mtl-1.1.0.2 should tell you which packages are affected, unregister those first (or later after unregistering mtl-1.1.0.2 with --force) and reinstall them against mtl-2. That doesn't work however, if any of them have a dependency bound mtl < 2, so check that first (and even if they have no upper bound on mtl, they may use the State or Writer, ... data constructors which aren't available anymore since State etc. are now type synonyms). Or upgrade to ghc-7.0.3 and install everything fresh.
Many thanks, Dominic.

Daniel Fischer wrote: Thanks for your quick reply.
Rebuild the libraries that depend on mtl against mtl-2.
$ ghc-pkg unregister mtl-1.1.0.2
should tell you which packages are affected, unregister those first (or later after unregistering mtl-1.1.0.2 with --force) and reinstall them against mtl-2. That doesn't work however, if any of them have a dependency bound mtl < 2, so check that first (and even if they have no upper bound on mtl, they may use the State or Writer, ... data constructors which aren't available anymore since State etc. are now type synonyms).
I had already tried that and I knew I had a lot of packages depending on mtl-1.
Or upgrade to ghc-7.0.3 and install everything fresh.
I feared this might be the answer :-) I'm about to buy a new computer so this is probably the way I will go. Many thanks for your help, Dominic.
participants (2)
-
Daniel Fischer
-
Dominic Steinitz