#2695: bogus "syntactically distinct contexts" error
-------------------------------------+--------------------------------------
Reporter: conal | Owner:
Type: bug | Status: new
Priority: low | Milestone: _|_
Component: Compiler (Type checker) | Version: 6.11
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown/Multiple
Os: Unknown/Multiple |
-------------------------------------+--------------------------------------
Changes (by simonpj):
* priority: normal => low
* milestone: 6.10.2 => _|_
Comment:
Good point. The requirement that the contexts of all the declarations in
a mutually recursive group must be identical, even though really we have
polymorphic recursion, is a very tiresome Haskell 98 thing. What is
biting us here is that we're trying to unify the two contexts, but since
`Basis` is a type function, knowing that `(Basis a1)` = `(Basis a2)` does
not allow us to conclude that `a1` = `a2`.
We could solve this by writing a syntactic-identity checker (oh, but it
has to be subject to alpha-renaming...), but it just doesn't seem worth
the bother.
The solution is to use `-XRelaxedPolyRec`, which lifts the restriction
altogether. Haskell Prime will probably have this as the default.
Meanwhile I'll leave this open at low priority.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2695#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs