storablevector 0.2.6 → 0.2.7
raw patch · 2 files changed
+14/−5 lines, 2 filesdep ~non-negative
Dependency ranges changed: non-negative
Files
- Data/StorableVector/Lazy.hs +11/−2
- storablevector.cabal +3/−3
Data/StorableVector/Lazy.hs view
@@ -86,6 +86,11 @@ instance Arbitrary ChunkSize where arbitrary = fmap (ChunkSize . max 1) arbitrary +{-+ToDo:+Since non-negative-0.1 we have the Monoid superclass for NonNeg.+Maybe we do not need the Num instance anymore.+-} instance Num ChunkSize where (ChunkSize x) + (ChunkSize y) = ChunkSize (x+y)@@ -95,9 +100,13 @@ signum = moduleError "ChunkSize.signum" "intentionally unimplemented" fromInteger = ChunkSize . fromInteger +instance Monoid ChunkSize where+ mempty = ChunkSize 0+ mappend (ChunkSize x) (ChunkSize y) = ChunkSize (x+y)+ mconcat = ChunkSize . sum . List.map (\(ChunkSize c) -> c)+ instance NonNeg.C ChunkSize where- (ChunkSize x) -| (ChunkSize y) =- ChunkSize $ if x >= y then x-y else 0+ split = NonNeg.splitDefault (\(ChunkSize c) -> c) ChunkSize chunkSize :: Int -> ChunkSize chunkSize x =
storablevector.cabal view
@@ -1,5 +1,5 @@ Name: storablevector-Version: 0.2.6+Version: 0.2.7 Category: Data Synopsis: Fast, packed, strict storable arrays with a list interface like ByteString Description:@@ -51,11 +51,11 @@ Source-Repository this type: darcs location: http://code.haskell.org/storablevector/- tag: 0.2.6+ tag: 0.2.7 Library Build-Depends:- non-negative >= 0.0.4 && <0.1,+ non-negative >= 0.1 && <0.2, utility-ht >= 0.0.5 && <0.1, transformers >=0.2 && <0.3, QuickCheck >= 1 && < 3