Proposal: Add Data instance for Const

Index Int vlad.z.4096 at gmail.com
Wed Nov 2 19:16:51 UTC 2016


The proposed instance is overconstrained. You only need Typeable for
the second argument of Const (because it is phantom).

On Wed, Nov 2, 2016 at 7:05 PM, Edward Kmett <ekmett at gmail.com> wrote:
> Definitely an oversight.
>
> On Wed, Nov 2, 2016 at 11:40 AM, Ryan Scott <ryan.gl.scott at gmail.com> wrote:
>>
>> GHC Trac #12438 [1] exists because there's no Data instance for Const
>> in base. I found this quite surprising, since we have Data instances
>> for just about every other type combinator out there (Identity, Sum,
>> Product, Compose, etc.), but not for Const. The fix for #12438 would
>> be quite simple: I propose we add
>>
>>     deriving instance (Data a, Data b) => Data (Const a b)
>>
>> to Data.Data in base. Any objections?
>>
>> Ryan S.
>> -----
>> [1] https://ghc.haskell.org/trac/ghc/ticket/12438
>> _______________________________________________
>> Libraries mailing list
>> Libraries at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>


More information about the Libraries mailing list