Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#10865 closed feature request (duplicate)

Poly-kinded Const

Reported by: int-index Owned by:
Priority: normal Milestone:
Component: Core Libraries Version: 7.10.2
Keywords: poly-kinded, Const Cc: RyanGlScott, ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Currently Const is defined as

newtype Const a b = Const { getConst :: a }

I propose to define it poly-kinded in the second argument like so:

newtype Const a (b :: k) = Const { getConst :: a }

This should be completely backwards-compatible.

Change History (7)

comment:1 Changed 3 years ago by goldfire

Simply enabling -XPolyKinds in the defining module should do the trick.

comment:2 Changed 3 years ago by thomie

Owner: ekmett deleted

comment:3 Changed 3 years ago by RyanGlScott

Cc: RyanGlScott ekmett added

comment:4 Changed 3 years ago by RyanGlScott

This is a duplicate of #10039, no?

comment:5 in reply to:  4 Changed 3 years ago by int-index

Replying to RyanGlScott:

This is a duplicate of #10039, no?

Oops, it is.

comment:6 Changed 3 years ago by int-index

Resolution: duplicate
Status: newclosed

comment:7 Changed 3 years ago by Ben Gamari <ben@…>

In edcf17b/ghc:

Move Const to own module in Data.Functor.Const and enable PolyKinds

`Const` from `Control.Applicative` can trivially be made
kind-polymorphic in its second argument. There has been a Trac issue
about this for nearly a year now. It doesn't look like anybody objects
to it, so I figured I might as well make a patch.

Trac Issues: #10039, #10865, #11135

Differential Revision:

Reviewers: ekmett, hvr, bgamari

Subscribers: RyanGlScott, thomie
Note: See TracTickets for help on using tickets.