[GHC] #10039: Make Const (Control.Applicative) kind polymorphic in its second argument

GHC ghc-devs at haskell.org
Wed Jan 28 14:00:47 UTC 2015


#10039: Make Const (Control.Applicative) kind polymorphic in its second argument
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                   Owner:  ekmett
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Core Libraries    |                 Version:  7.8.4
      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 Iceland_jack):

 Another example of a kind polymorphic `Const` is in the paper [[http://www
 .andres-loeh.de/TrueSumsOfProducts/TrueSumsOfProducts.pdf|True Sums of
 Products]] by Edsko de Vries and Andres Löh, defined in section '''2.
 Preliminaries''':


 {{{#!hs
 newtype I (a :: *)          = I { unI :: a }
 newtype K (a :: *) (b :: k) = K { unK :: a }
 }}}

 noting:

   These are similar to their definitions in the standard libraries (called
 `Identity` and `Constant`, respectively), but the definition of `K` makes
 use of GHC's `PolyKinds` extension and is ''kind polymorphic''; we will
 need this generality.

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


More information about the ghc-tickets mailing list