git-annex/Types/DesktopNotify.hs
Joey Hess 9a5ddda511
remove many old version ifdefs
Drop support for building with ghc older than 8.4.4, and with older
versions of serveral haskell libraries than will be included in Debian 10.

The only remaining version ifdefs in the entire code base are now a couple
for aws!

This commit should only be merged after the Debian 10 release.
And perhaps it will need to wait longer than that; it would make
backporting new versions of  git-annex to Debian 9 (stretch) which
has been actively happening as recently as this year.

This commit was sponsored by Ilya Shlyakhter.
2019-07-05 15:09:37 -04:00

31 lines
702 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
import Data.Monoid
import qualified Data.Semigroup as Sem
import Prelude
data DesktopNotify = DesktopNotify
{ notifyStart :: Bool
, notifyFinish :: Bool
}
deriving (Show)
instance Sem.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