[GHC] #14111: strange error when using data families with levity polymorphism and unboxed sums and data families

GHC ghc-devs at haskell.org
Fri Aug 25 15:17:37 UTC 2017


#14111: strange error when using data families with levity polymorphism and unboxed
sums and data families
-------------------------------------+-------------------------------------
        Reporter:  carter            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:  TypeFamilies
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 simonpj):

 I did mean "instantiate the head shape with unification variables".

 In our example, the head shape is `T a [a]`. So, when checking `T1`, I
 instantiate the head shape with unification varibles `T alpha [alpha]` and
 unify with the result of the data con `T Bool [Bool]`.  Success, and the
 substitution for alpha tells me about the necessary equality constraints.

 The payoff is that the rigid bits of the head shape get to instantiate any
 kind-unification-variables floating around in the result type of the data
 constructor.  So this has to be done before we kind-generalise the data
 constructor's type.

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


More information about the ghc-tickets mailing list