[GHC] #11310: Surprising accepted constructor for GADT instance of data family

GHC ghc-devs at haskell.org
Wed Dec 30 14:44:26 UTC 2015


#11310: Surprising accepted constructor for GADT instance of data family
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 This is a documentation bug more than an implementation bug (or perhaps a
 design bug).

 In contrast to type families, data family results must always have kind
 `*`. And the variables in a data family declaration have no scope anyway
 (ignoring `TypeInType` stuff), so a user may usefully say

 {{{#!hs
 data family DF1 :: * -> Nat -> *
 }}}

 as equivalent to

 {{{#!hs
 data family DF2 x (y :: Nat)
 }}}

 Because type families may have higher-kinded results (that is, result
 kinds with arrows), type families have to distinguish between proper
 arguments and components of the result.

 Do you have an improvement to suggest, in either the design or
 documentation? I admit this inconsistency is quite surprising, but I don't
 have a better approach in mind.

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


More information about the ghc-tickets mailing list