deepseq: Add more instances. #50

Travis Whitaker pi.boy.travis at gmail.com
Wed Jan 15 09:22:50 UTC 2020


If the Control.DeepSeq module exports an error-yielding instance, then one
would need to newtype all their ForeignPtrs in order to define their own
correct NFData instance. Naturally I’m biased, but that seems like quite a
hoop to jump through to get correct but subtle behavior. I’m not sure the
core libraries go to such lengths to hide correct-but-tricky behavior
anywhere else; I’d be interested in seeing existing examples of this.

On Wed, Jan 15, 2020 at 1:13 AM Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Wed, 15 Jan 2020, Travis Whitaker wrote:
>
> > If such an error-yielding instance were added, how would users who need
> > the correct-but-potentially-confusing behaving NFData instance cope with
> > this?
>
> In the criterion/record example they would manually implement the NFData
> instance for the record, as you already suggested.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200115/747673e9/attachment-0001.html>


More information about the Libraries mailing list