PolyKinds, Control.Category and GHC 7.6.1

Would it be possible to add something like {-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif to the top of Control.Category before the 7.6.1 final release? Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds. I only noticed that it wasn't there in the release candidate just now. -Edward Kmett

Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
What, precisely, is the benefit of turning on PolyKinds for that file without changing the code? If we're cpp'ing it in, then are there further benefits that we could also reap by cpp'ing some code changes? -- Dan Burton

On Mon, Aug 13, 2012 at 9:55 AM, Dan Burton
Control.Category.Category is pretty much the only type in base that
directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
What, precisely, is the benefit of turning on PolyKinds for that file without changing the code? If we're cpp'ing it in, then are there further benefits that we could also reap by cpp'ing some code changes?
The benefit is that the kind of Category changes to Category :: (x -> x -> *) -> Constraint This means I can do things like make data Dict p where Dict :: p => Dict p newtype a |- b = Sub (a => Dict b) and then (|-) :: Constraint -> Constraint -> * is a valid candidate to become a Category. Moreover, PolyKinds + DataKinds finally enable us to write product and sum categories, make categories for natural transformations, and generally finally put Category to work. These were all disallowed by the previous simpler kind. No code changes need be applied beyond permitting the type of Category to generalize and existing code continues to work. This change actually could have been applied in 7.4.1. -Edward Kmett

On Mon, Aug 13, 2012 at 10:16 AM, Edward Kmett
Would it be possible to add something like
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif
to the top of Control.Category before the 7.6.1 final release?
Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
I only noticed that it wasn't there in the release candidate just now.
-Edward Kmett
+1, this would be nice.
This change actually could have been applied in 7.4.1.
FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it led to compile failures in downstream modules, so this wouldn't necessarily have been painless. Hopefully with 7.6 it will be. -- Your ship was destroyed in a monadic eruption.

| FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it | led to compile failures in downstream modules, so this wouldn't | necessarily have been painless. Hopefully with 7.6 it will be. PolyKinds is not an advertised feature of 7.4, so you should absolutely not rely on it working in 7.4. But it IS an advertised feature for 7.6 and should work flawlessly. (If not, yell.) Simon

I presume people are still interested in this. I actually just ran
into Category's non poly-kinded-ness the other day (while attempting
to make a Category instance for promoted pairs) and found this email
in my history.
Can we schedule this for 7.8.1? There's -plenty- of time, and the
addendum to Control.Category that Edward posted originally is pretty
much all that is needed. If that sounds OK, I can post a patch for
review or commit it directly to base.
On Tue, Aug 14, 2012 at 6:14 AM, Simon Peyton-Jones
| FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it | led to compile failures in downstream modules, so this wouldn't | necessarily have been painless. Hopefully with 7.6 it will be.
PolyKinds is not an advertised feature of 7.4, so you should absolutely not rely on it working in 7.4. But it IS an advertised feature for 7.6 and should work flawlessly. (If not, yell.)
Simon
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Regards, Austin - PGP: 4096R/0x91384671

Fine by me.. it's a library question at this point, so if the librarians are happy so am I
Simon
Microsoft Research Limited (company number 03369488) is registered in England and Wales
Registered office 21 Station Road, Cambridge, CB1 2FB
| -----Original Message-----
| From: Austin Seipp [mailto:aseipp@pobox.com]
| Sent: 16 May 2013 17:00
| To: Simon Peyton-Jones
| Cc: Gábor Lehel; Edward Kmett; Ian Lynagh; Haskell Libraries; ghc-
| devs@haskell.org
| Subject: Re: PolyKinds, Control.Category and GHC 7.6.1
|
| I presume people are still interested in this. I actually just ran into
| Category's non poly-kinded-ness the other day (while attempting to make
| a Category instance for promoted pairs) and found this email in my
| history.
|
| Can we schedule this for 7.8.1? There's -plenty- of time, and the
| addendum to Control.Category that Edward posted originally is pretty
| much all that is needed. If that sounds OK, I can post a patch for
| review or commit it directly to base.
|
| On Tue, Aug 14, 2012 at 6:14 AM, Simon Peyton-Jones
|

+1 from me.
I've pretty much abandoned all work on anything that descends from
Control.Category in the absence of this for the last year and have just
been using homegrown classes, which isn't a very satisfying solution.
On Thu, May 16, 2013 at 12:00 PM, Austin Seipp
I presume people are still interested in this. I actually just ran into Category's non poly-kinded-ness the other day (while attempting to make a Category instance for promoted pairs) and found this email in my history.
Can we schedule this for 7.8.1? There's -plenty- of time, and the addendum to Control.Category that Edward posted originally is pretty much all that is needed. If that sounds OK, I can post a patch for review or commit it directly to base.
On Tue, Aug 14, 2012 at 6:14 AM, Simon Peyton-Jones
wrote: | FWIW PolyKinds in 7.4 is rough, and I had experiences where enabling it | led to compile failures in downstream modules, so this wouldn't | necessarily have been painless. Hopefully with 7.6 it will be.
PolyKinds is not an advertised feature of 7.4, so you should absolutely not rely on it working in 7.4. But it IS an advertised feature for 7.6 and should work flawlessly. (If not, yell.)
Simon
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
-- Regards, Austin - PGP: 4096R/0x91384671

Also, apologies for reviving a thread. I also did not include Edward's original message for better context. It is inline below. -------------------------- Would it be possible to add something like {-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif to the top of Control.Category before the 7.6.1 final release? Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds. I only noticed that it wasn't there in the release candidate just now. -Edward Kmett -------------------------- -- Regards, Austin - PGP: 4096R/0x91384671

As noted by Simon, the bound on that should be >= 706 though.
On Thu, May 16, 2013 at 12:02 PM, Austin Seipp
Also, apologies for reviving a thread. I also did not include Edward's original message for better context. It is inline below.
-------------------------- Would it be possible to add something like
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif
to the top of Control.Category before the 7.6.1 final release?
Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
I only noticed that it wasn't there in the release candidate just now.
-Edward Kmett --------------------------
-- Regards, Austin - PGP: 4096R/0x91384671

Very well then. If there are no objections in the typical 2wk time
frame*, I will craft a patch to base and commit it to fix this.
* Technically, some might consider this proposal open for 9 months.
I'm new to library changes however, so I'll go by all the rules as I
should. :)
On Thu, May 16, 2013 at 11:02 AM, Edward Kmett
As noted by Simon, the bound on that should be >= 706 though.
On Thu, May 16, 2013 at 12:02 PM, Austin Seipp
wrote: Also, apologies for reviving a thread. I also did not include Edward's original message for better context. It is inline below.
-------------------------- Would it be possible to add something like
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif
to the top of Control.Category before the 7.6.1 final release?
Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
I only noticed that it wasn't there in the release candidate just now.
-Edward Kmett --------------------------
-- Regards, Austin - PGP: 4096R/0x91384671
-- Regards, Austin - PGP: 4096R/0x91384671

This is now done:
commit b1fc62762c56ccaa536d41b49a2aa0866e7420f7
Author: Austin Seipp
Very well then. If there are no objections in the typical 2wk time frame*, I will craft a patch to base and commit it to fix this.
* Technically, some might consider this proposal open for 9 months. I'm new to library changes however, so I'll go by all the rules as I should. :)
On Thu, May 16, 2013 at 11:02 AM, Edward Kmett
wrote: As noted by Simon, the bound on that should be >= 706 though.
On Thu, May 16, 2013 at 12:02 PM, Austin Seipp
wrote: Also, apologies for reviving a thread. I also did not include Edward's original message for better context. It is inline below.
-------------------------- Would it be possible to add something like
{-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE PolyKinds #-} #endif
to the top of Control.Category before the 7.6.1 final release?
Control.Category.Category is pretty much the only type in base that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds.
I only noticed that it wasn't there in the release candidate just now.
-Edward Kmett --------------------------
-- Regards, Austin - PGP: 4096R/0x91384671
-- Regards, Austin - PGP: 4096R/0x91384671
-- Regards, Austin - PGP: 4096R/0x91384671
participants (5)
-
Austin Seipp
-
Dan Burton
-
Edward Kmett
-
Gábor Lehel
-
Simon Peyton-Jones