
Now that ghc 9.0.2 is the oldest supported version. Eg cruft from https://web.archive.org/web/20190424185034/https://prime.haskell.org/wiki/Libraries/Proposals/SemigroupMonoid Sponsored-by: Jack Hill
27 lines
624 B
Haskell
27 lines
624 B
Haskell
{- git-annex DesktopNotify type
|
|
-
|
|
- Copyright 2014 Joey Hess <id@joeyh.name>
|
|
-
|
|
- Licensed under the GNU AGPL version 3 or higher.
|
|
-}
|
|
|
|
module Types.DesktopNotify where
|
|
|
|
data DesktopNotify = DesktopNotify
|
|
{ notifyStart :: Bool
|
|
, notifyFinish :: Bool
|
|
}
|
|
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
|
|
|
|
mkNotifyStart :: DesktopNotify
|
|
mkNotifyStart = DesktopNotify True False
|
|
|
|
mkNotifyFinish :: DesktopNotify
|
|
mkNotifyFinish = DesktopNotify False True
|