From a9b9e5d0d72c2348580dbac5533b89a45abd8938 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 19 Jan 2022 13:11:40 -0500 Subject: Deal with the Semigroup/Monoid proposal base-4.11 made Semigroup a superclass of Monoid. Provide Semigroup implementations for Monoids. --- Types/DesktopNotify.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Types/DesktopNotify.hs') 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 + - Copyright 2022 Benjamin Barenblat - - 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 -- cgit v1.2.3