[vector] #54: Missing NFData instances for vector types

vector vector at projects.haskell.org
Sun Jan 29 12:10:59 GMT 2012


#54: Missing NFData instances for vector types
------------------------+---------------------------------------------------
Reporter:  hvr          |        Owner:          
    Type:  enhancement  |       Status:  reopened
Priority:  blocker      |    Milestone:  0.10    
 Version:  0.7          |   Resolution:          
Keywords:               |  
------------------------+---------------------------------------------------
Changes (by rl):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 Actually, I'm not sure that the `NFData` instance for boxed mutable
 vectors is safe. Compare this:

 {{{
 do
   write v 0 x
   rnf v `seq` return ()
 }}}

 with this:

 {{{
 do
   rnf v `seq` return ()
   write v 0 x
 }}}

 Assuming that the `write` can't fail, if `rnf` is pure then the two should
 be equivalent. But they clearly aren't.

 It seems that for mutable vectors, you'd need a monadic version of `rnf`.
 Maybe that's something that the `deepseq` package should provide.

 I'll comment out the instance in question and reopen the ticket for now.

-- 
Ticket URL: <http://trac.haskell.org/vector/ticket/54#comment:13>
vector <http://trac.haskell.org/vector>
Package vector


More information about the vector mailing list