hwsl2 0.3.1.1 → 0.3.2.0
raw patch · 2 files changed
+26/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Hash.SL2.Chunk: Chunk :: Hash -> ByteString -> Chunk
+ Data.Hash.SL2.Chunk: data Chunk
+ Data.Hash.SL2.Chunk: fromByteString :: ByteString -> Chunk
+ Data.Hash.SL2.Chunk: getChunkBytes :: Chunk -> ByteString
+ Data.Hash.SL2.Chunk: getChunkHash :: Chunk -> Hash
+ Data.Hash.SL2.Chunk: instance Eq Chunk
+ Data.Hash.SL2.Chunk: instance Monoid Chunk
+ Data.Hash.SL2.Chunk: instance Ord Chunk
Files
- hwsl2.cabal +2/−1
- src/Data/Hash/SL2/Chunk.hs +24/−0
hwsl2.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.3.1.1+version: 0.3.2.0 -- A short (one-line) description of the package. synopsis: Hashing with SL2@@ -73,6 +73,7 @@ library -- Modules exported by the library. exposed-modules: Data.Hash.SL2+ Data.Hash.SL2.Chunk Data.Hash.SL2.Mutable Data.Hash.SL2.Unsafe
+ src/Data/Hash/SL2/Chunk.hs view
@@ -0,0 +1,24 @@+module Data.Hash.SL2.Chunk where++import Data.ByteString+import Data.Hash.SL2+import Data.Monoid++data Chunk = Chunk+ { getChunkHash :: Hash+ , getChunkBytes :: ByteString+ }++instance Eq Chunk where+ a == b = getChunkHash a == getChunkHash b++instance Ord Chunk where+ compare a b = compare (getChunkHash a) (getChunkHash b)++instance Monoid Chunk where+ mempty = Chunk mempty mempty+ mappend a b = Chunk (getChunkHash a <> getChunkHash b) (getChunkBytes a <> getChunkBytes b)+ mconcat as = Chunk (mconcat $ fmap getChunkHash as) (mconcat $ fmap getChunkBytes as)++fromByteString :: ByteString -> Chunk+fromByteString b = Chunk (hash b) b