Proposal: add -XPolyKinds to Data.Monoid

Niklas Haas haskell at nand.wakku.to
Mon Jul 14 17:46:23 UTC 2014


On Mon, 14 Jul 2014 10:37:55 -0600, Carl Howells <chowells79 at gmail.com> 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.


More information about the Libraries mailing list