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
participants (4)
-
Dan Burton
-
Edward Kmett
-
Gábor Lehel
-
Simon Peyton-Jones