diff options
Diffstat (limited to 'haskell/Data/VCDIFF.hs')
-rw-r--r-- | haskell/Data/VCDIFF.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/haskell/Data/VCDIFF.hs b/haskell/Data/VCDIFF.hs index fe4cc98..db75fb1 100644 --- a/haskell/Data/VCDIFF.hs +++ b/haskell/Data/VCDIFF.hs | |||
@@ -273,6 +273,9 @@ data Result x = Result | |||
273 | -- is an error code and message indicating what. | 273 | -- is an error code and message indicating what. |
274 | } deriving (Show,Functor) | 274 | } deriving (Show,Functor) |
275 | 275 | ||
276 | instance Semigroup x => Semigroup (Result x) where | ||
277 | Result x xe <> y = Result (x <> result y) (maybe (resultError y) Just xe) | ||
278 | |||
276 | instance Monoid x => Monoid (Result x) where | 279 | instance Monoid x => Monoid (Result x) where |
277 | mempty = Result mempty Nothing | 280 | mempty = Result mempty Nothing |
278 | mappend (Result x xe) y = Result (mappend x $ result y) (maybe (resultError y) Just xe) | 281 | mappend (Result x xe) y = Result (mappend x $ result y) (maybe (resultError y) Just xe) |