packages feed

libnotify 0.2 → 0.2.1

raw patch · 3 files changed

+25/−7 lines, 3 files

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+0.2.1+=====++  * Added `Semigroup (Mod a)` to satisfy GHC 8.4+ 0.2 === 
libnotify.cabal view
@@ -1,5 +1,5 @@ name:               libnotify-version:            0.2+version:            0.2.1 synopsis:           Bindings to libnotify library description:   The package provides a high level interface to libnotify API (see "Libnotify")@@ -11,7 +11,7 @@ author:             Emon Tsukimiya, Matvey Aksenov maintainer:         Matvey Aksenov <matvey.aksenov@gmail.com> category:           System, Desktop-cabal-version:      >= 1.10+cabal-version:      >= 1.18 build-type:         Simple extra-doc-files:   asset/*.png@@ -28,7 +28,7 @@ source-repository this   type:     git   location: https://github.com/supki/libnotify-  tag:      0.2+  tag:      0.2.1  library   default-language:
src/Libnotify.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NamedFieldPuns #-} -- | High level interface to libnotify API@@ -24,15 +25,16 @@   , noactions   , appName   , reuse-    -- * Convenience re-exports-  , Monoid(..), (<>)   ) where  import Control.Applicative ((<$)) import Data.ByteString (ByteString) import Data.Int (Int32) import Data.Maybe (fromMaybe)-import Data.Monoid (Monoid(..), (<>), Last(..))+import Data.Monoid (Monoid(..), Last(..))+#if MIN_VERSION_base(4,9,0)+import Data.Semigroup (Semigroup(..))+#endif import Data.Word (Word8) import Graphics.UI.Gtk.Gdk.Pixbuf (Pixbuf) import System.Glib.Properties (objectSetPropertyString)@@ -85,10 +87,21 @@ data Mod a = -- the unused type parameter cannot be removed without breaking backward compatibility   Mod (Last NotifyNotification) (Last String) (NotifyNotification -> String -> IO ()) +#if MIN_VERSION_base(4,9,0)+instance Semigroup (Mod a) where+  Mod u x fx <> Mod v y fy =+    Mod (u <> v) (x <> y) (\token name -> fx token name >> fy token name)+#endif+ instance Monoid (Mod a) where   mempty = Mod mempty mempty (\_ _ -> return ())+#if MIN_VERSION_base(4,11,0)+#elif MIN_VERSION_base(4,9,0)+  mappend = (<>)+#else   mappend (Mod u x fx) (Mod v y fy) =-    Mod (u <> v) (x <> y) (\token name -> fx token name >> fy token name)+    Mod (mappend u v) (mappend x y) (\token name -> fx token name >> fy token name)+#endif  -- | Set notification summary --