#1723: type unsafety with type family + GADT
----------------------------------------+-----------------------------------
Reporter: [EMAIL PROTECTED] | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 6.8
Severity: major | Resolution:
Keywords: | Difficulty: Unknown
Os: Unknown | Testcase:
Architecture: Unknown |
----------------------------------------+-----------------------------------
Comment (by simonpj):
A splendid bug thank you! It relates to GHC's incomplete state. We
currently have the ''old'' implementation of GADTs uneasily co-existing
with the ''new'' implementation of type families. Manuel is about to nuke
the old GADT stuff in favour of the new type-family stuff.
I'm sure you can see what is going wrong here; after all, you came up with
it. What we plan to do is to use `T`'s real type:
{{{
T :: forall p q. (q ~ Const p) => p -> T q
}}}
Then in the case alternative, we'll have `y::p` (where `p` is
existentially bound)along with the assumption `q ~ Const p`. From the
scrutinee we get `q = Const b`, so the constraint becomes `Const b ~ Const
p`, and that tells nothing about `p`.
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1723>
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