[GHC] #14060: TH-reified types can suffer from kind signature oversaturation

GHC ghc-devs at haskell.org
Mon Jul 31 02:49:46 UTC 2017


#14060: TH-reified types can suffer from kind signature oversaturation
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Template Haskell  |              Version:  8.2.1
      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 RyanGlScott):

 After re-reading, I'm not sure myself what "if the tycon is applied to any
 required arguments, then apply their kinds to the tycon's kind before
 doing further analysis" means. But you've laid out a much better plan of
 attach than I ever could. Thanks!

 > If `T` is oversaturated, no annotation is necessary. Otherwise, we can
 assume `ki0` has the form `forall k1 ... km. s1 -> ... -> sn -> p`.

 What happens if we have a dependent quantifier like `forall km -> s1 ->
 ... -> sn -> p`? Would `km` be included in `K`? My hunch is "yes".

 > An injective position in a type `ty` is either `ty` itself, an injective
 position within an injective argument to a tycon, an injective position in
 a function, or an injective position in the argument to a type variable.

 The "`ty` itself" bit confuses me. Did you mean "a `ty` itself is in an
 injective position if `ty` is a tyvar"? I'm guessing you didn't intend for
 it to be interpreted as "a `ty` itself is always in an injective
 position", since that would mean that all the variables in `InjTyFam a ...
 z` would count, where `InjTyFam` is an injective type family.

 > I do think this is considerably easier than invoking unification.

 Certainly. But I know close to nothing about how GHC's unifier works, so
 this is a pretty low bar for me personally :)

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


More information about the ghc-tickets mailing list