[GHC] #15362: Template Haskell ignores bad type family definitions

GHC ghc-devs at haskell.org
Wed Jul 11 19:00:58 UTC 2018


#15362: Template Haskell ignores bad type family definitions
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Template       |           Version:  8.4.3
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This garbage is accepted:

 {{{#!hs
 data Nat = Zero | Succ Nat

 $( [d| type family a + b where
          Maybe Zero b = b
          Succ a + b = Succ (a + b) |] )
 }}}


 Note the `Maybe` photo-bombing in the first equation. The problem is that
 TH uses the symbol declared in the family head for all the equations,
 ignoring what's actually there. This is sad.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15362>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list