Opened 2 years ago

Closed 2 years ago

Last modified 2 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:

Description

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 2 years ago by goldfire

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

comment:2 Changed 2 years ago by thomie

Owner: ekmett deleted

comment:3 Changed 2 years ago by RyanGlScott

Cc: RyanGlScott ekmett added

comment:4 Changed 2 years ago by RyanGlScott

This is a duplicate of #10039, no?

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

Replying to RyanGlScott:

This is a duplicate of #10039, no?

Oops, it is.

comment:6 Changed 2 years ago by int-index

Resolution: duplicate
Status: newclosed

comment:7 Changed 2 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: https://phabricator.haskell.org/D1630

Reviewers: ekmett, hvr, bgamari

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