#2944: Mutually recursive equality constraints
----------------------------------+-----------------------------------------
Reporter: MartijnVanSteenbergen | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 6.10.1 | Severity: normal
Keywords: | Testcase:
Os: MacOS X | Architecture: x86
----------------------------------+-----------------------------------------
Given this piece of code:
{{{
{-# LANGUAGE TypeFamilies #-}
class C a where
type T a :: *
f1 :: T a ~ () => a
f1 = f2
f2 :: T a ~ () => a
f2 = f1
}}}
GHC complains:
{{{
Couldn't match expected type `T a ~ ()'
against inferred type `T a1 ~ ()'
When matching the contexts of the signatures for
f1 :: forall a. (T a ~ ()) => a
f2 :: forall a. (T a ~ ()) => a
The signature contexts in a mutually recursive group should all be
identical
When generalising the type(s) for f1, f2
}}}
Is this a bug? Enabling RelaxedPolyRec fixes the problem. Should
TypeFamilies—just like GADTs—imply RelaxedPolyRec?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2944>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs