Commits

Aleksey Khudyakov committed 960188e

Use NFData instance for vector

  • Participants
  • Parent commits 0e01b9b

Comments (0)

Files changed (2)

File Data/Histogram/Generic.hs

 
 -- | Vector do not supply 'NFData' instance so let just 'seq' it and
 --   hope it's enough. Should be enough for unboxed vectors.
-instance (NFData a, NFData bin) => NFData (Histogram v bin a) where
-   rnf (Histogram bin uo vec) = 
-     rnf bin `seq` rnf uo `seq` seq vec ()
+instance (NFData a, NFData bin, NFData (v a)) => NFData (Histogram v bin a) where
+   rnf (Histogram bin uo vec) =
+     rnf bin `seq` rnf uo `seq` rnf vec `seq` ()
 
 -- | If vector is a functor then histogram is functor as well
 instance (Functor v) => Functor (Histogram v bin) where

File histogram-fill.cabal

   Build-Depends:        base >=3 && <5,
                         deepseq,
                         primitive,
-                        vector >= 0.7
+                        vector >= 0.10.0.1
   Exposed-modules:      Data.Histogram
                         Data.Histogram.Generic
                         Data.Histogram.Fill