diff --git a/src/Tahoe/SDMF/Internal/Share.hs b/src/Tahoe/SDMF/Internal/Share.hs index 0bbad62f553d93c651f20e7870e6500bfa88b876..d370bbc202e0a85e2479a16a400644a048831f93 100644 --- a/src/Tahoe/SDMF/Internal/Share.hs +++ b/src/Tahoe/SDMF/Internal/Share.hs @@ -24,7 +24,7 @@ hashSize = 32 newtype HashChain = HashChain { hashChain :: [(Word16, B.ByteString)] } - deriving newtype (Eq, Show) + deriving newtype (Eq, Show, Semigroup) instance Binary HashChain where put (HashChain []) = mempty @@ -40,8 +40,7 @@ instance Binary HashChain where else do n <- getWord16be h <- getByteString hashSize - (HashChain c) <- get - pure $ HashChain ((n, h) : c) + (HashChain [(n, h)] <>) <$> get {- | Structured representation of a single version SDMF share.