haskell / deepseq

Deep evaluation of data structures
http://hackage.haskell.org/package/deepseq
Other
40 stars 29 forks source link

Add NFData instance for ByteArray #65

Closed Bodigrim closed 2 years ago

Bodigrim commented 3 years ago

ByteArray has just landed into GHC HEAD: https://gitlab.haskell.org/ghc/ghc/-/commit/1f8090933268b1ca071bc4a8a35b0f1828a76fce

Up to you whether to merge it now or warehouse until GHC 9.4 RC.

I'm not particularly proud of reviving Control.DeepSeq.BackDoor, but it feels wrong to mark Data.ByteArray itself as Safe or even Trustworthy, because it uses unsafeCoerce# and manipulates state tokens manually. How do you feel about it?

Bodigrim commented 3 years ago

Test evidence: https://app.travis-ci.com/github/Bodigrim/deepseq/builds/234626517

Bodigrim commented 2 years ago

@cigsender this is ready for review now. Cf. https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6742