Changes between Version 5 and Version 6 of TemplateHaskellRichKinds


Ignore:
Timestamp:
Mar 26, 2012 1:59:42 AM (3 years ago)
Author:
goldfire
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TemplateHaskellRichKinds

    v5 v6  
    1717| ConK Name               -- for kinds of the form Bool
    1818| VarK Name               -- k
    19 | ForallK [Name] Kind     -- forall k. ...
    2019| AppK Kind Kind          -- k1 k2
    2120| ListK                   -- []
     
    2423}}}
    2524
    26 The final {{{Kind}}} constructor does not need any special binder construct because all kinds are of sort {{{BOX}}}.
     25Note that there is no {{{ForallK}}} constructor because the internal GHC representation for kinds with variables does not use this. Kinds are automatically generalized over an entire type expression.
    2726
    2827TH will also need to support promoted constructors other than lists and tuples, but this is in fact already supported through the use of {{{ConT}}}. The namespace of defined types and of promoted types is also already kept distinct. For example, if we have the definition {{{data Foo = Foo}}}, the results of {{{ [t| Foo |] }}} and {{{ [t| 'Foo |] }}} are distinct (as in, {{{==}}} returns {{{False}}}). However, applying {{{show}}} to these two results produces the same string. Using the naming quote syntax, we can access promoted data constructors using the single-quote form. For example, {{{ConT 'False}}} denotes the promoted data constructor {{{'False}}}. (Note that the parsed interpretations of the {{{'}}} in these two snippets are entirely unrelated.)