#2627: GADT + Type family doesn't unify like I expect
-------------------------------------+--------------------------------------
Reporter: ryani | Owner: chak
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 6.9
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
-------------------------------------+--------------------------------------
Comment (by ryani):
While playing around with this I also found a crash bug:
{{{conn (Rd k) (Wr a r) = undefined -- typechecks successfully}}}
{{{conn (Rd k) (Wr a r) = conn undefined undefined -- crashes}}}
{{{
ghc: panic! (the 'impossible' happened)
(GHC version 6.11.20080925 for i386-apple-darwin):
TcTyFuns.uMeta: unexpected synonym family
}}}
Interestingly, this example just fails to typecheck:
{{{urk () = conn undefined undefined}}}
with an unhelpful error message:
{{{
Dual.hs:1:0:
Couldn't match expected type `a'
against inferred type `Dual (Dual a)'
}}}
Note the line number of the error... If I remove the () to force the
monomorphism restriction to kick in, the line number is more helpful.
I find it fascinating that with type equality constraints, "undefined" is
no longer a valid argument at all call-sites.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2627#comment:3>
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