Proposal: Adding generics-based rnf-helper to `deepseq`

Herbert Valerio Riedel hvr at gnu.org
Fri Sep 21 11:58:14 CEST 2012


Henning Thielemann <lemming at henning-thielemann.de> writes:

> On Fri, 21 Sep 2012, Herbert Valerio Riedel wrote:
>
>> Henning Thielemann <lemming at henning-thielemann.de> writes:
>>
>>> As far as I know, deepseq is currently plain Haskell 98. This would no
>>> longer be true with a dependency on generics. Thus I would prefer to
>>> keep deepseq and generic-deepseq separated.
>>
>> that's right (although one could make that an optional feature of the
>> `deepseq` package, depending on the availability of the
>> generics-feature, so that `deepseq` could still build with a pure H98
>> compiler)
>
> And how would one write packages that depend on deepseq, that can be
> compiled easily on both, say, GHC and JHC?

afaics, if you choose (which is an explicit decision) to make use of
`genericRnf`, you already have to provide `Generic` instances in your
client code, thus your code already is beyond Haskell98 as it uses the
Generics GHC extension.

If you don't make use of the `genericRnf` then there's no harm, as your
code would work with a `deepseq` package compiled in "H98 compatibility
mode"... or am I overlooking something?



More information about the Libraries mailing list