David Lazar | 15 Mar 22:56 2013

Data instance for Data.Version

Hi,

Can we derive Data for Data.Version.Version? It would benefit Cabal.

Thanks,
David
Edward A Kmett | 15 Mar 23:29 2013
Picon

Re: Data instance for Data.Version

+1 from me. I've had to use an orphan

Sent from my iPhone

On Mar 15, 2013, at 5:56 PM, David Lazar <lazar6 <at> illinois.edu> wrote:

> Hi,
> 
> Can we derive Data for Data.Version.Version? It would benefit Cabal.
> 
> Thanks,
> David
> 
> _______________________________________________
> Libraries mailing list
> Libraries <at> haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
Herbert Valerio Riedel | 12 Sep 13:24 2013
Picon

Re: Data instance for Data.Version

Hello *,

As we're still in time to get this in before the GHC 7.8 freeze and this
seems to be "the right thing" to do, are there any objections to
implement this (specifically, adding a `deriving Data` to `base`s
Data.Version for GHC 7.8.1)?

Cheers,
  hvr

On 2013-03-15 at 23:29:21 +0100, Edward A Kmett wrote:
> +1 from me. I've had to use an orphan
>
> Sent from my iPhone
>
> On Mar 15, 2013, at 5:56 PM, David Lazar <lazar6 <at> illinois.edu> wrote:
>
>> Hi,
>> 
>> Can we derive Data for Data.Version.Version? It would benefit Cabal.
>> 
>> Thanks,
>> David
>> 
>> _______________________________________________
>> Libraries mailing list
>> Libraries <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries

--

-- 
(Continue reading)

Edward Kmett | 12 Sep 17:55 2013
Picon

Re: Data instance for Data.Version

Please do! I've had to orphan that in a couple of projects.

-Edward


On Thu, Sep 12, 2013 at 7:24 AM, Herbert Valerio Riedel <hvr <at> gnu.org> wrote:
Hello *,

As we're still in time to get this in before the GHC 7.8 freeze and this
seems to be "the right thing" to do, are there any objections to
implement this (specifically, adding a `deriving Data` to `base`s
Data.Version for GHC 7.8.1)?

Cheers,
  hvr

On 2013-03-15 at 23:29:21 +0100, Edward A Kmett wrote:
> +1 from me. I've had to use an orphan
>
> Sent from my iPhone
>
> On Mar 15, 2013, at 5:56 PM, David Lazar <lazar6 <at> illinois.edu> wrote:
>
>> Hi,
>>
>> Can we derive Data for Data.Version.Version? It would benefit Cabal.
>>
>> Thanks,
>> David
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries

--
"Elegance is not optional" -- Richard O'Keefe

_______________________________________________
Libraries mailing list
Libraries <at> haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Edward Kmett | 13 Sep 09:24 2013
Picon

Re: Data instance for Data.Version

If the instances are hand-rolled in base, you'll need:

instance Data Version where gfoldl k z (Version bs ts) = z Version `k` bs `k` ts gunfold k z c = case constrIndex c of 1 -> k (k (z Version)) _ -> error "Data.Data.gunfold(Version)" toConstr (Version _ _) = versionConstr dataTypeOf _ = versionType versionConstr :: Constr versionConstr = mkConstr versionType "Version" ["versionBranch","versionTags"] Prefix versionType :: DataType versionType = mkDataType "Data.Version.Version" [versionConstr]


On Thu, Sep 12, 2013 at 7:24 AM, Herbert Valerio Riedel <hvr <at> gnu.org> wrote:
Hello *,

As we're still in time to get this in before the GHC 7.8 freeze and this
seems to be "the right thing" to do, are there any objections to
implement this (specifically, adding a `deriving Data` to `base`s
Data.Version for GHC 7.8.1)?

Cheers,
  hvr

On 2013-03-15 at 23:29:21 +0100, Edward A Kmett wrote:
> +1 from me. I've had to use an orphan
>
> Sent from my iPhone
>
> On Mar 15, 2013, at 5:56 PM, David Lazar <lazar6 <at> illinois.edu> wrote:
>
>> Hi,
>>
>> Can we derive Data for Data.Version.Version? It would benefit Cabal.
>>
>> Thanks,
>> David
>>
>> _______________________________________________
>> Libraries mailing list
>> Libraries <at> haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries

--
"Elegance is not optional" -- Richard O'Keefe

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

Gmane