histogram-fill-binary 0.6.2.1 → 0.8.5.0
raw patch · 2 files changed
+12/−4 lines, 2 filesdep ~histogram-fill
Dependency ranges changed: histogram-fill
Files
Data/Histogram/Binary.hs view
@@ -1,6 +1,7 @@-{-# OPTIONS_GHC -fno-warn-orphans #-}+{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} -- | Cereal instances for histogram-fill module Data.Histogram.Binary ( ) where@@ -11,6 +12,7 @@ import Data.Histogram.Bin import Data.Histogram.Bin.MaybeBin+import Data.Histogram.Bin.BinVar import Data.Histogram.Generic (Histogram, histogramUO, histData, outOfRange, bins) @@ -58,6 +60,12 @@ deriving instance (Binary bin) => Binary (MaybeBin bin) +instance (G.Vector v a, G.Vector v Bool, Binary a, Ord a) => Binary (BinVarG v a) where+ get = binVar <$> do n <- get+ G.replicateM n get+ put b = do let v = cuts b+ put (G.length v)+ G.forM_ v put ----------------------------------------------------------------
histogram-fill-binary.cabal view
@@ -1,5 +1,5 @@ Name: histogram-fill-binary-Version: 0.6.2.1+Version: 0.8.5.0 Synopsis: Binary instances for histogram-fill package Description: Binary instances for histogram-fill package@@ -25,8 +25,8 @@ Library Build-Depends: base >=3 && <5, binary,- vector >= 0.7,- histogram-fill >= 0.6+ vector >= 0.7,+ histogram-fill >= 0.8.5.0 Exposed-modules: Data.Histogram.Binary Ghc-options: -Wall Ghc-prof-options: -auto-all