[GHC] #10541: Expose kind information for type variables with reify

GHC ghc-devs at haskell.org
Thu Jun 18 11:46:34 UTC 2015


#10541: Expose kind information for type variables with reify
-------------------------------------+-------------------------------------
        Reporter:  spinda            |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Template Haskell  |                 Version:  7.10.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by goldfire):

 I think we can actually do a bit better. It should be possible to tell
 whether we fully know a type variable's kind, by looking through the
 (zonked) kind for any `MetaTv`s. If there aren't any, then the kind is
 fully known and can be reported. Otherwise, don't report.

 The problem with my approach here is that it's fragile, depending
 delicately on the order that GHC reads through a type. Perhaps your
 solution is better: report the kind only when it is robustly known, either
 through a kind annotation or other means. (For "other means", I mean, for
 example, when a type variable is in scope in a term, via
 !ScopedTypeVariables. These type variables are generally fully known.)

 But how do we know when the tyvar's kind is robustly known... or even just
 annotated? By the time `reify` is called, we've lost a lot of that
 information.

 There's ''something'' we can do for you in this space, but I'm not sure
 exactly what yet.

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


More information about the ghc-tickets mailing list