aboutsummaryrefslogtreecommitdiff
path: root/Types/DesktopNotify.hs
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbarenblat@gmail.com>2022-01-19 13:11:40 -0500
committerGravatar Benjamin Barenblat <bbarenblat@gmail.com>2022-01-19 13:31:05 -0500
commita9b9e5d0d72c2348580dbac5533b89a45abd8938 (patch)
tree0f8113e86df43616baec8570b07acb1537497885 /Types/DesktopNotify.hs
parentc79473051a8e1647b14f351b72768b74301acc33 (diff)
Deal with the Semigroup/Monoid proposal
base-4.11 made Semigroup a superclass of Monoid. Provide Semigroup implementations for Monoids.
Diffstat (limited to 'Types/DesktopNotify.hs')
-rw-r--r--Types/DesktopNotify.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Types/DesktopNotify.hs b/Types/DesktopNotify.hs
index e6df05ab1..0b2da9377 100644
--- a/Types/DesktopNotify.hs
+++ b/Types/DesktopNotify.hs
@@ -1,6 +1,7 @@
{- git-annex DesktopNotify type
-
- Copyright 2014 Joey Hess <id@joeyh.name>
+ - Copyright 2022 Benjamin Barenblat <bbarenblat@gmail.com>
-
- Licensed under the GNU GPL version 3 or higher.
-}
@@ -16,10 +17,12 @@ data DesktopNotify = DesktopNotify
}
deriving (Show)
+instance Semigroup DesktopNotify where
+ DesktopNotify s1 f1 <> DesktopNotify s2 f2 =
+ DesktopNotify (s1 || s2) (f1 || f2)
+
instance Monoid DesktopNotify where
mempty = DesktopNotify False False
- mappend (DesktopNotify s1 f1) (DesktopNotify s2 f2) =
- DesktopNotify (s1 || s2) (f1 || f2)
mkNotifyStart :: DesktopNotify
mkNotifyStart = DesktopNotify True False