restless-git 0.6 → 0.7
raw patch · 2 files changed
+7/−5 lines, 2 files
Files
- restless-git.cabal +1/−1
- src/Restless/Git.hs +6/−4
restless-git.cabal view
@@ -1,5 +1,5 @@ name: restless-git-version: 0.6+version: 0.7 category: Git synopsis: Easy Git repository serialization description:
src/Restless/Git.hs view
@@ -21,7 +21,7 @@ import Data.ByteString (ByteString) import Data.Foldable (toList) import Data.Map (Map)-import Data.Monoid ((<>))+import Data.Semigroup ((<>)) import Data.Set (Set) import Data.Text (Text, unpack) import Data.Text.Encoding (decodeUtf8)@@ -43,12 +43,14 @@ data Tree a = Tree (Map ByteString (Tree a)) (Map ByteString a) deriving (Functor, Show) +instance Semigroup (Tree a) where+ Tree a b <> Tree c d =+ Tree (Map.unionWith mappend a c)+ (Map.union b d)+ instance Monoid (Tree a) where mempty = Tree mempty mempty- mappend (Tree a b) (Tree c d) =- Tree (Map.unionWith mappend a c)- (Map.union b d) -- | Initialize an empty repository at the given path. make