diff options
author | tv <tv@krebsco.de> | 2019-01-25 01:43:05 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2019-01-25 01:43:44 +0100 |
commit | ccd7117c31074069414eb00dd0b7ed6b648ddeff (patch) | |
tree | ccfd7c6ad2b85790b48e3dfe12f6bfe32957afd8 | |
parent | b160288682bea77c03ef245e6fdaba6244c64f34 (diff) |
Blessings: satisfy Semigroup and Monoid lawsv1.4.0
-rw-r--r-- | blessings.cabal | 2 | ||||
-rw-r--r-- | src/Blessings.hs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/blessings.cabal b/blessings.cabal index 1dc6122..1b13a57 100644 --- a/blessings.cabal +++ b/blessings.cabal @@ -3,7 +3,7 @@ build-type: Simple cabal-version: >= 1.2 license: MIT name: blessings -version: 1.1.0 +version: 1.4.0 library build-depends: base 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 |