[GHC] #5601: Proposal: Add NFData instances for strict and lazy ByteStrings

GHC cvs-ghc at haskell.org
Fri Nov 4 11:23:40 CET 2011


#5601: Proposal: Add NFData instances for strict and lazy ByteStrings
---------------------------------+------------------------------------------
    Reporter:  basvandijk        |       Owner:                   
        Type:  feature request   |      Status:  new              
    Priority:  normal            |   Component:  libraries (other)
     Version:  7.2.1             |    Keywords:                   
    Testcase:                    |   Blockedby:                   
          Os:  Unknown/Multiple  |    Blocking:                   
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown     
---------------------------------+------------------------------------------
 I noticed strict and lazy `ByteString`s don't have `NFData` instances. I
 [http://www.haskell.org/pipermail/libraries/2011-October/016970.html
 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5601>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list