On Fri, Dec 21, 2012 at 01:45:04PM +0000, Simon Peyton-Jones wrote:
> OK, do this
> 
> * {-# LANGUAGE ScopedTypeVariables, MonoLocalBinds #-}
> 
> * import Categs( Domains1 )
> 
> * Add type sig for dP'
>     dP' :: (LinSolvRing (Pol a), CommutativeRing a) => Domains1 (Pol a)
> 
> Then it compiles.
> 
> You are very close to the edge of what can be done!


It works. Thank you.

There remains only a single unlucky module:  T_cubeext.
The test  demotest/Main  works with exception of  T_cubeext,
but I need  T_cubeext.cubicExt  to work.

Please, continue the test with

  make install
  cd demotest
  ghc $doconCpOpt --make Main

(for  $doconCpOpt =  
  -fwarn-unused-matches -fwarn-unused-binds -fwarn-unused-imports 
  -fno-warn-overlapping-patterns -XRecordWildCards -XNamedFieldPuns 
  -XFlexibleContexts -XMultiParamTypeClasses -XUndecidableInstances 
  -XTypeSynonymInstances -XFlexibleInstances -XOverlappingInstances
).

It reports

------------------------------------------------------------------
...
T_cubeext.hs:102:20:
    Could not deduce (k ~ k1)
    from the context (Field k, FactorizationRing (UPol k))
      bound by the type signature for
                 cubicExt :: (Field k, FactorizationRing (UPol k)) =>
                             k -> k -> Domains1 k -> (Domains1 (E k), [E k], k 
-> E k)
      at T_cubeext.hs:(79,13)-(80,69)
    or from (Field k1, FactorizationRing (UPol k1))
      bound by the type signature for
                 unA :: (Field k1, FactorizationRing (UPol k1)) => UPol k1
      at T_cubeext.hs:101:9-56
      `k' is a rigid type variable bound by
          the type signature for
            cubicExt :: (Field k, FactorizationRing (UPol k)) =>
                        k -> k -> Domains1 k -> (Domains1 (E k), [E k], k -> E 
k)
          at T_cubeext.hs:79:13
      `k1' is a rigid type variable bound by
           the type signature for
             unA :: (Field k1, FactorizationRing (UPol k1)) => UPol k1
           at T_cubeext.hs:101:9
    Expected type: Domains1 k1
      Actual type: Domains1 k
    In the second argument of `cToUPol', namely `dK'
    In the expression: cToUPol "d" dK unK
    In an equation for `unA': unA = cToUPol "d" dK unK

T_cubeext.hs:105:7:
    Overlapping instances for LinSolvRing (UPol k1)
      arising from a use of `upEucRing'
    Matching instances:
      instance [overlap ok] EuclideanRing a => LinSolvRing (UPol a)
        -- Defined in `docon-2.12:Pol2_'
      instance [overlap ok] (LinSolvRing (Pol a), CommutativeRing a) =>
                            LinSolvRing (UPol (Pol a))
...
------------------------------------------------------------------

I tried  {-# LANGUAGE ScopedTypeVariables, MonoLocalBinds #-},
and setting type signatures in various parts in  cubicExt.
But this does not help.

There is another point. In 
         ``cubicExt :: (Field k, FactorizationRing (UPol k)) => ...''

the part       ``, FactorizationRing (UPol k)''                  (1)

was always considered as parasitic.  ghc-7.4.1  needs (1) to work,
and at least  ghc-7.4.1  does compile the test.

I thought, may be, the future compilers will allow to omit this part.
At least it is desirable for  ghc-7.6.2  to do the test in any variant,
with (1) or without it. 

Regards,

------
Sergei

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to