Proposal: Add NFData instances for strict and lazy ByteStrings
I noticed strict and lazy ByteString
s don't have NFData
instances. I proposed to add them because it enables users to force ByteString
s in the principled way (using deepseq
) so they don't need to use tricks like: B.length b
seq ...
instance NFData Strict.ByteString
instance NFData Lazy.ByteString where
rnf Empty = ()
rnf (Chunk _ b) = rnf b
Note that the containers
dependency of deepseq
was recently dropped so depending on that package is not a big issue anymore.
We had 8 +1s and no objections.
Trac metadata
Trac field | Value |
---|---|
Version | 7.2.1 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | libraries (other) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |