Opened 6 years ago

Closed 6 years ago

#5601 closed feature request (fixed)

Proposal: Add NFData instances for strict and lazy ByteStrings

Reported by: basvandijk Owned by:
Priority: normal Milestone:
Component: libraries (other) Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


I noticed strict and lazy ByteStrings don't have NFData instances. I proposed to add them because it enables users to force ByteStrings 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.

Attachments (2)

Change History (4)

comment:1 Changed 6 years ago by basvandijk

Keep in mind that because of the added instances the major version has to be bumped from to 0.10.

comment:2 Changed 6 years ago by duncan

Resolution: fixed
Status: newclosed


Note: See TracTickets for help on using tickets.