DoCon and GHC

Simon Peyton-Jones simonpj at
Thu Jan 3 00:27:15 CET 2013

I made a second mistake. I meant (LinSolvRing (UPol k)).  Apologies.

|  > I don't know why 7.4 accepts it, but I'm not inclined to investigate...
|  > looks like a bug in 7.4.
|  ghc-7.4.1 may use a special trick, but is correct.

I don't understand your explanation.  What is wrong with this reasoning?

1.  The call to upEucRing in cubicExt gives rise the constraint (LinSolvRing (UPol k))

2. There are two overlapping instances for (LinSolvRing (UPol k)), 
    defined in UPol2_ and UPol3_

3.  So GHC cannot solve the constraint using an instance declaration.

4. The type signature provides
     (Field k, FactorizationRing (UPol k))
   but neither is enough to satisfy LinSolvRing (UPol k).

5.  Therefore we  must add LinSolvRing (UPol k) to the signature.

If you believe that the function should typecheck as-is, please explain how to deduce (LinSolvRing (UPol k)) from (Field k, FactorizationRing (UPol k)).


More information about the Glasgow-haskell-users mailing list