Proposal: add -XPolyKinds to Data.Monoid

At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *. Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy <interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile. This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals. Thanks.

On Mon, 14 Jul 2014 10:37:55 -0600, Carl Howells
At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks.
+1 out of principle due to it being a harmless change that should be invisible to most users. It's a bit unclear what the purpose of this would be, but it's similarly unclear what the purpose of the Monoid instance on Proxy in general is. I wonder what you actually need this for.

I don't actually have a use case. I was just looking at Data.Monoid in
depth for some other changes I'd like to propose, and noticed that
instance was needlessly restrictive. This proposal was made for the
same reason you're in favor - it might make something better for
someone someday, and shouldn't make anything worse.
On Mon, Jul 14, 2014 at 11:46 AM, Niklas Haas
On Mon, 14 Jul 2014 10:37:55 -0600, Carl Howells
wrote: At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks.
+1 out of principle due to it being a harmless change that should be invisible to most users.
It's a bit unclear what the purpose of this would be, but it's similarly unclear what the purpose of the Monoid instance on Proxy in general is.
I wonder what you actually need this for. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

+1 for me. The Monoid instance for Proxy was polykinded in its argument in
tagged, it just lost the polymorphism in the move into base.
-Edward
On Mon, Jul 14, 2014 at 2:21 PM, Carl Howells
I don't actually have a use case. I was just looking at Data.Monoid in depth for some other changes I'd like to propose, and noticed that instance was needlessly restrictive. This proposal was made for the same reason you're in favor - it might make something better for someone someday, and shouldn't make anything worse.
On Mon, Jul 14, 2014 at 11:46 AM, Niklas Haas
wrote: On Mon, 14 Jul 2014 10:37:55 -0600, Carl Howells
wrote: At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks.
+1 out of principle due to it being a harmless change that should be invisible to most users.
It's a bit unclear what the purpose of this would be, but it's similarly unclear what the purpose of the Monoid instance on Proxy in general is.
I wonder what you actually need this for. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

The example works with ghc-7.6.3. It looks like
https://github.com/ghc/ghc/commit/1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11
is to blame.
On Mon, Jul 14, 2014 at 12:37 PM, Carl Howells
At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Everything about this case is different in GHC 7.6.3 anyway.
Data.Proxy isn't in base, its Monoid instance isn't defined in
Data.Monoid.
On Mon, Jul 14, 2014 at 12:51 PM, adam vogt
The example works with ghc-7.6.3. It looks like https://github.com/ghc/ghc/commit/1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11 is to blame.
On Mon, Jul 14, 2014 at 12:37 PM, Carl Howells
wrote: At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Ah yeah. I remember when we moved it. We just accidentally lost the
PolyKinds along the way. Should be easy enough to fix.
On Mon, Jul 14, 2014 at 2:51 PM, adam vogt
The example works with ghc-7.6.3. It looks like https://github.com/ghc/ghc/commit/1d1ff77aaa09efaddc8cfe0dcf92d6763297cf11 is to blame.
On Mon, Jul 14, 2014 at 12:37 PM, Carl Howells
wrote: At the moment, the Monoid instance for Data.Proxy.Proxy is only defined for types with kind *.
Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy String) <> Proxy Proxy Prelude Data.Proxy Data.Monoid> :set -XDataKinds Prelude Data.Proxy Data.Monoid> (Proxy :: Proxy 5) <> Proxy
<interactive>:8:20: No instance for (Monoid (Proxy 5)) arising from a use of ‘<>’ In the expression: (Proxy :: Proxy 5) <> Proxy In an equation for ‘it’: it = (Proxy :: Proxy 5) <> Proxy
Enabling -XPolyKinds while compiling the Data.Monoid module is the only change necessary to make the Monoid instance for Proxy polykinded like Proxy itself is. I don't believe adding a language pragma would have any other effect on that module, and I believe the only effect of changing that instance would be allowing more correct programs to compile.
This is my first proposal to this list, so I'm starting with something that I hope isn't controversial. Let me know if I should do anything different procedurally in future proposals.
Thanks. _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +1. This is just a minor regression. I tested this out this morning, and added a ticket & patch[0]. [0] https://ghc.haskell.org/trac/ghc/ticket/9317 - -- Alexander alexander@plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlPFBfEACgkQRtClrXBQc7WifgEAlQqd9t10hs0QGzfxhqmgK5x8 iUWpgs28nWXoYq/+CJMA/0xshKZYDNzgAnFzhqaAJ3FIiIrmD8Z0J42OyjotW5Ci =2X0n -----END PGP SIGNATURE-----
participants (5)
-
adam vogt
-
Alexander Berntsen
-
Carl Howells
-
Edward Kmett
-
Niklas Haas