report on 7.01-pre

Serge D. Mechveliani mechvel at
Thu Sep 30 11:34:25 EDT 2010

Dear GHC developers, 

contains a bug report on              ghc-
tested on  Debian Linux, i386-family.

Its essence is as follows. At the fragment of

instance (LinSolvRing (Pol a), CommutativeRing a) =>                  -- (1)
                                           LinSolvRing (UPol (Pol a))
  gxBasis  []       = ([], [])
  gxBasis  fs@(f:_) =
      UPol _ p y dP    = f
      (o, n)           = (pPPO p, genericLength $ pVars p)
      (toLex, fromLex) = (reordPol $ lexPPO n, reordPol o)
      p'               = toLex p
      dP'              = upLinSolvRing p' Map.empty
      s' = cToUPol y dP' p'

in the module  Pol3_.hs,  ghc-  reports that 
the line of  `s' ='  needs  (EuclideanRing a)  and that it cannot deduce 

ghc-6.12.2  compiles this in a correct way:
(EuclideanRing a)  is not necessary here, while the context (1) is more 
generic and sufficient.
For example, for  a = DirectSum Integer Integer, 
`a' has the instances (1) and has not the instance of Euclidean, and
the above code must work.
This is the idea of the author of the application; 
this idea is supported by ghc-6.12.2 and not supported by  

There are the two questions.
1) Whether this intention with instances is correct in the meaning of
   Haskell + ghcExt  
   (I hope, it is correct, at least, ghc-6.12.2 accepts it).
2) If it is correct, why   ghc-  requires (Euclidean a) ?

a) This application uses multiparametric classes and overlapping 
   instances (see docon.cabal for language and other options).
b) The example code can be reduced further, many times.
   But I may have time to reduce it maybe only in the middle of 
   December 2010.


Serge Mechveliani
mechvel at

More information about the Glasgow-haskell-users mailing list