DoCon and GHC

Simon Peyton-Jones simonpj at microsoft.com
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))
     Corect?

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

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

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

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)).


Simon


More information about the Glasgow-haskell-users mailing list