Edward Kmett | 13 Aug 10:16 2012
Picon

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
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Dan Burton | 13 Aug 15:55 2012
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

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
_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Edward Kmett | 13 Aug 16:12 2012
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1


On Mon, Aug 13, 2012 at 9:55 AM, Dan Burton <danburton.email <at> gmail.com> wrote:
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

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Gábor Lehel | 14 Aug 02:15 2012
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

On Mon, Aug 13, 2012 at 10:16 AM, Edward Kmett <ekmett <at> gmail.com> wrote:
> 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.
Simon Peyton-Jones | 14 Aug 13:14 2012
Picon

RE: PolyKinds, Control.Category and GHC 7.6.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.

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
Austin Seipp | 16 May 18:00 2013
Picon

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
<simonpj@...> 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@...
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

--

-- 
Regards,
Austin - PGP: 4096R/0x91384671
Austin Seipp | 16 May 18:02 2013
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

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
Edward Kmett | 16 May 18:02 2013
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

As noted by Simon, the bound on that should be >= 706 though.


On Thu, May 16, 2013 at 12:02 PM, Austin Seipp <aseipp <at> pobox.com> 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

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Austin Seipp | 16 May 19:02 2013
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

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 <ekmett@...> wrote:
> As noted by Simon, the bound on that should be >= 706 though.
>
>
> On Thu, May 16, 2013 at 12:02 PM, Austin Seipp <aseipp@...> 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
Austin Seipp | 30 May 15:27 2013
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

This is now done:

commit b1fc62762c56ccaa536d41b49a2aa0866e7420f7
Author: Austin Seipp <aseipp@...>
Date:   Thu May 30 07:33:01 2013 -0500

    Enable PolyKinds for Control.Category.

    This change will allow us to make various new things instances of
    Category, such as promoted tuples.

    Original discussion from libraries@...:

      http://www.haskell.org/pipermail/libraries/2012-August/018268.html

    Fell off the radar. No complaints in the 2 week period since being
    brought up again:

      http://www.haskell.org/pipermail/libraries/2013-May/019845.html

    Patch from Edward Kmett (essentially.)

    Authored-by: Edward Kmett <ekmett@...>
    Signed-off-by: Austin Seipp <aseipp@...>

On Thu, May 16, 2013 at 12:02 PM, Austin Seipp <aseipp@...> wrote:
> 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 <ekmett@...> wrote:
>> As noted by Simon, the bound on that should be >= 706 though.
>>
>>
>> On Thu, May 16, 2013 at 12:02 PM, Austin Seipp <aseipp@...> 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
Simon Peyton-Jones | 16 May 18:01 2013
Picon

RE: PolyKinds, Control.Category and GHC 7.6.1

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@...]
| Sent: 16 May 2013 17:00
| To: Simon Peyton-Jones
| Cc: Gábor Lehel; Edward Kmett; Ian Lynagh; Haskell Libraries; ghc-
| devs@...
| 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
| <simonpj@...> 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@...
| > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
| 
| 
| 
| --
| Regards,
| Austin - PGP: 4096R/0x91384671
Edward Kmett | 16 May 18:02 2013
Picon

Re: PolyKinds, Control.Category and GHC 7.6.1

+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 <aseipp <at> pobox.com> wrote:
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
<simonpj <at> microsoft.com> 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 <at> haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



--
Regards,
Austin - PGP: 4096R/0x91384671

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries

Gmane