packages feed

storablevector 0.2.12.1 → 0.2.13

raw patch · 5 files changed

+25/−4 lines, 5 filesdep +semigroups

Dependencies added: semigroups

Files

src/Data/StorableVector.hs view
@@ -209,6 +209,7 @@                                  mapM, sequence_, return, (=<<), (>>=), (>>), ) import Data.Functor             (fmap, ) import Data.Monoid              (Monoid, mempty, mappend, mconcat, )+import Data.Semigroup           (Semigroup, (<>), )  import qualified Data.List as List import qualified Data.List.HT as ListHT@@ -235,6 +236,9 @@  instance (Storable a, Eq a) => Eq (Vector a) where     (==) = equal++instance (Storable a) => Semigroup (Vector a) where+    (<>) = append  instance (Storable a) => Monoid (Vector a) where     mempty  = empty
src/Data/StorableVector/Lazy.hs view
@@ -113,6 +113,7 @@ import Foreign.Storable (Storable)  import Data.Monoid (Monoid, mempty, mappend, mconcat, )+import Data.Semigroup (Semigroup, (<>), ) -- import Control.Arrow ((***)) import Control.Monad (liftM, liftM2, liftM3, liftM4, mfilter, ) @@ -157,6 +158,9 @@ newtype Vector a = SV {chunks :: [V.Vector a]}  +instance (Storable a) => Semigroup (Vector a) where+    (<>) = append+ instance (Storable a) => Monoid (Vector a) where     mempty  = empty     mappend = append@@ -197,6 +201,9 @@    abs  =  moduleError "ChunkSize.abs" "intentionally unimplemented"    signum  =  moduleError "ChunkSize.signum" "intentionally unimplemented"    fromInteger = ChunkSize . fromInteger++instance Semigroup ChunkSize where+   ChunkSize x <> ChunkSize y = ChunkSize (x+y)  instance Monoid ChunkSize where    mempty = ChunkSize 0
src/Data/StorableVector/Lazy/Builder.hs view
@@ -24,6 +24,7 @@ import Control.Monad (liftM2, ) import Control.Monad.ST.Strict (ST, runST, ) import Data.Monoid (Monoid(mempty, mappend), )+import Data.Semigroup (Semigroup((<>)), )  import Foreign.Storable (Storable, ) @@ -58,11 +59,15 @@ Storable constraint not needed in the current implementation, but who knows what will be in future ... -}+instance Storable a => Semigroup (Builder a) where+   {-# INLINE (<>) #-}+   x <> y = Builder (\cs -> run x cs . run y cs)+ instance Storable a => Monoid (Builder a) where    {-# INLINE mempty #-}    {-# INLINE mappend #-}    mempty = Builder (\_ -> id)-   mappend x y = Builder (\cs -> run x cs . run y cs)+   mappend = (<>)   {- |
src/Data/StorableVector/Lazy/Typed.hs view
@@ -105,6 +105,7 @@ import Data.Tuple.HT (mapPair, mapFst, mapSnd) import Data.Maybe.HT (toMaybe) import Data.Monoid (Monoid, mempty, mappend, mconcat)+import Data.Semigroup (Semigroup, (<>), ) import Data.Either (Either) import Data.Maybe (Maybe(Just)) import Data.Function (flip, ($), (.))@@ -180,6 +181,9 @@    Vector size e lift4 f (SV a) (SV b) (SV c) (SV d) = SV (f a b c d) ++instance (Size size, Storable a) => Semigroup (Vector size a) where+    (<>) = append  instance (Size size, Storable a) => Monoid (Vector size a) where     mempty  = empty
storablevector.cabal view
@@ -1,5 +1,5 @@ Name:                storablevector-Version:             0.2.12.1+Version:             0.2.13 Category:            Data Synopsis:            Fast, packed, strict storable arrays with a list interface like ByteString Description:@@ -28,7 +28,7 @@ Tested-With:         GHC==6.8.2, GHC==6.12.3 Tested-With:         GHC==7.4.1, GHC==7.6.2, GHC==7.8.2 Tested-With:         JHC==0.7.3-Cabal-Version:       >=1.14+Cabal-Version:       1.14 Extra-Source-Files:   foreign-ptr/fast/Data/StorableVector/Memory.hs   foreign-ptr/slow/Data/StorableVector/Memory.hs@@ -48,7 +48,7 @@ Source-Repository this   type:     darcs   location: http://code.haskell.org/storablevector/-  tag:      0.2.12.1+  tag:      0.2.13   Library@@ -56,6 +56,7 @@     non-negative >=0.1 && <0.2,     utility-ht >=0.0.5 && <0.1,     transformers >=0.2 && <0.6,+    semigroups >=0.1 && <1.0,     deepseq >=1.3 && <1.5,     unsafe >=0.0 && <0.1,     QuickCheck >=1 && <3