[GHC] #12088: Promote data family instance constructors

GHC ghc-devs at haskell.org
Sat Aug 6 00:25:49 UTC 2016


#12088: Promote data family instance constructors
-------------------------------------+-------------------------------------
        Reporter:  alexvieth         |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #11348            |  Differential Rev(s):  Phab:D2272
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 I don't really understand your suggestion Richard.

 Firstly, we often infer the kind of a data type, so it's hard to separate
 dependence on its kind from dependendence on its definition.  I din't
 undersand the precise dependency analysis that you informally propose.

 Secondly, I think that open type families are indeed the odd one out, as
 you acknowledge in the "odd conundrum".  I don't see what's gained by
 separating types from defns even if we could.

 Thirdly, you suggest kind-checking all equations for a type family
 together as a single group.  But you can't do that if they mention data
 types that have not yet been defined.  Yet we can't delay too long ...
 getting those instances into play early is the whole point.

 Fourth, the dependence may be indirect.  In the example, Open2 mentions
 Open1 directly. But it could instead mention F directly, where F is an
 open family that has an equation like `type instance F [t] = Open1 t`.
 Now the dependence on Open1 is hidden.

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


More information about the ghc-tickets mailing list