Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-07 Thread dag.odenh...@gmail.com
Also: Platform includes QuickCheck which has a conditional API for TemplateHaskell support. I wouldn't be surprised if there are more examples like that. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskel

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-07 Thread dag.odenh...@gmail.com
A note: if you use generic-deriving instead of ghc-prim, the generics code could in theory be portable as well. That package re-exports from ghc-prim when compiled with GHC, and provides a compatible fallback implementation. ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-07 Thread dag.odenh...@gmail.com
On Tue, Nov 6, 2012 at 3:32 PM, Herbert Valerio Riedel wrote: > Clark Gaebel writes: > | There's no disadvantage to having the generic functionality in a > | separate package, right? > Well for one it means you can't simply write instance Class Type but must write instance Class Ty

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-07 Thread Clark Gaebel
Your first link says that any library in the Haskell Platform must be supported on all operating systems and compilers supported by the Haskell Platform. Right now, the platform only supports GHC, and on Windows, Linux, and Mac. This change does not break any of those. I say this because if someon

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-06 Thread Herbert Valerio Riedel
Clark Gaebel writes: > For the merge into Hashable, the default instance is only included if we're > on a compatible GHC. I originally tried to make the same argument for enhancing `deepseq`, but I was made aware this would lead to a conditional API, which is frowned upon, or to quote a succinct

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-06 Thread Clark Gaebel
For the merge into Hashable, the default instance is only included if we're on a compatible GHC. This means Hashable itself will be portable, but it strongly encourages other packages not to be. I think the portability requirement is just used as an easy way to filter out lower quality code, anywa

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-06 Thread Herbert Valerio Riedel
Clark Gaebel writes: > How would the ghc-dependance affect hashable's inclusion in the haskell > platform? Doesn't the haskell platform ship only a recent version of ghc > (i.e. one with support for generics)? I was under the impression that the haskell platform, albeit currently bundling GHC, a

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Clark Gaebel
How would the ghc-dependance affect hashable's inclusion in the haskell platform? Doesn't the haskell platform ship only a recent version of ghc (i.e. one with support for generics)? - Clark On Nov 4, 2012 6:00 PM, "Herbert Valerio Riedel" wrote: > Clark Gaebel writes: > > > @dag: > > > > I w

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Herbert Valerio Riedel
Clark Gaebel writes: > @dag: > > I would love for this to be merged into Data.Hashable, and I think it would > make a lot of people's lives easier, and prevent them from writing bad hash > functions accidentally. Jfyi, a discussion came up when I posted a proposal to add a generics-based NFData

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Clark Gaebel
Yes. Sorry if I wasn't clear. That's what I intended. So would a patch adding this to hashable be accepted? - Clark On Sun, Nov 4, 2012 at 11:39 AM, Johan Tibell wrote: > On Sun, Nov 4, 2012 at 8:35 AM, Clark Gaebel wrote: > > > > @dag: > > > > I would love for this to be merged into Data.H

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread dag.odenh...@gmail.com
On Sun, Nov 4, 2012 at 5:39 PM, Johan Tibell wrote: > Couldn't we do it using GHC's default implementations based on > signatures features, so we don't have to expose any new things in the > API? > > We used that in unordered-containers like so: > > #ifdef GENERICS > default parseRecord :: (G

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Johan Tibell
On Sun, Nov 4, 2012 at 8:35 AM, Clark Gaebel wrote: > > @dag: > > I would love for this to be merged into Data.Hashable, and I think it would > make a lot of people's lives easier, and prevent them from writing bad hash > functions accidentally. Couldn't we do it using GHC's default implementa

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Clark Gaebel
@dag: I would love for this to be merged into Data.Hashable, and I think it would make a lot of people's lives easier, and prevent them from writing bad hash functions accidentally. - Clark On Sun, Nov 4, 2012 at 10:30 AM, dag.odenh...@gmail.com < dag.odenh...@gmail.com> wrote: > Have you ta

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Clark Gaebel
Thanks a lot! I've updated the benchmark accordingly, and have released a new version without the 1.3x slowdown disclaimer as generic-hashable 1.1.8. - Clark On Sun, Nov 4, 2012 at 10:25 AM, Herbert Valerio Riedel wrote: > Clark Gaebel writes: > > [...] > > > Oh yeah, and if anyone wants t

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread dag.odenh...@gmail.com
Have you talked with upstream about possibly adding this to hashable proper, using DefaultSignatures? CPP can be used to make it portable to older GHC versions. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-04 Thread Herbert Valerio Riedel
Clark Gaebel writes: [...] > Oh yeah, and if anyone wants to help me figure out why it's 1.3x slower > than my hand-rolled instances, that would be really helpful. [...] I've taken a look at the bench/Bench.hs benchmark[1]: The generated Core looks almost[2] the same as your 'HandRolled'; but

[Haskell-cafe] [ANNOUNCE] hashable-generics

2012-11-02 Thread Clark Gaebel
Hi everybody! I have just released a handy package on Hackage that will interest you if you've ever used unordered-containers with a custom type. In order to do such a thing, you'd need to define an instance of Hashable. This process could easily be automated. And so I did. {-# LANGUAGE DeriveG