summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-01-25 01:43:05 +0100
committertv <tv@krebsco.de>2019-01-25 01:43:44 +0100
commitccd7117c31074069414eb00dd0b7ed6b648ddeff (patch)
treeccfd7c6ad2b85790b48e3dfe12f6bfe32957afd8 /src
parentb160288682bea77c03ef245e6fdaba6244c64f34 (diff)
Blessings: satisfy Semigroup and Monoid lawsv1.4.0
Diffstat (limited to 'src')
-rw-r--r--src/Blessings.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Blessings.hs b/src/Blessings.hs
index 21fe3d8..56c1af0 100644
--- a/src/Blessings.hs
+++ b/src/Blessings.hs
@@ -5,7 +5,6 @@ module Blessings where
import Control.Applicative
import Data.List
-import Data.Semigroup
import Data.String
import Data.Ix (inRange)
@@ -37,11 +36,14 @@ instance Functor Blessings where
instance Semigroup (Blessings a) where
- (<>) = Append
+ t <> Empty = t
+ Empty <> t = t
+ Append t1 t2 <> Append t3 t4 = t1 <> t2 <> t3 <> t4
+ Append t1 t2 <> t3 = t1 <> t2 <> t3
+ t1 <> t2 = Append t1 t2
instance Monoid (Blessings a) where
- mappend = Append
mempty = Empty