Skip to content

Template Haskell quotes of data instance GADTs is totally broken

When I say

data family Fuggle x y
[d| data instance Fuggle Int (Maybe (a,b)) where
      MkFuggle :: Fuggle Int (Maybe Bool) |]

I get (with -ddump-splices)

    [d| data instance Fuggle Int (Maybe (a_ajz6, b_ajz7))
          where MkFuggle_ajz5 :: Fuggle Int (Maybe Bool) |]
  ======>
    data instance Fuggle Int (Maybe (a_ajAf, b_ajAg))
      = (b_ajAg ~ Maybe Bool, a_ajAf ~ Int) => MkFuggle_ajAe

But that's not at all what I said! Admittedly, what I said was garbage, but it should fail outright.

Is this addressed by D1465?

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC jstolarek
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information