gnuplot 0.5.5 → 0.5.5.1
raw patch · 3 files changed
+17/−8 lines, 3 filesdep +semigroupsdep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: semigroups
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- gnuplot.cabal +3/−2
- src/Graphics/Gnuplot/Private/Display.hs +9/−4
- src/Graphics/Gnuplot/Private/Plot.hs +5/−2
gnuplot.cabal view
@@ -1,5 +1,5 @@ Name: gnuplot-Version: 0.5.5+Version: 0.5.5.1 License: BSD3 License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -51,7 +51,7 @@ data/runtime.data Source-Repository this- Tag: 0.5.5+ Tag: 0.5.5.1 Type: darcs Location: http://code.haskell.org/gnuplot/ @@ -81,6 +81,7 @@ data-accessor-transformers >=0.2.1 && <0.3, data-accessor >=0.2.2 && <0.3, transformers >=0.3 && <0.6,+ semigroups >=0.1 && <1.0, deepseq >=1.0 && <1.5, process >=1.0 && <1.7, time >=1.5 && <1.9,
src/Graphics/Gnuplot/Private/Display.hs view
@@ -8,6 +8,7 @@ import qualified Control.Monad.Trans.State as MS import Control.Monad (liftM2, return, ) import Data.Monoid (Monoid, mempty, mappend, )+import Data.Semigroup (Semigroup, (<>), ) import Prelude (FilePath, String, Int, ($), (.), ) @@ -29,23 +30,27 @@ type OptionSet = Map.Map Option.T [String] +instance Semigroup Script where+ Script b0 <> Script b1 = Script (liftM2 (<>) b0 b1)+ {- Could also be implemented with Control.Monad.Trans.State: mappend = liftA2 mappend -} instance Monoid Script where mempty = Script $ return mempty- mappend (Script b0) (Script b1) =- Script (liftM2 mappend b0 b1)+ mappend = (<>) +instance Semigroup Body where+ Body f0 c0 <> Body f1 c1 = Body (f0 <> f1) (c0 <> c1)+ {- Could also be implemented with Control.Monad.Trans.State: mappend = liftA2 mappend -} instance Monoid Body where mempty = Body mempty mempty- mappend (Body f0 c0) (Body f1 c1) =- Body (mappend f0 f1) (mappend c0 c1)+ mappend = (<>) class C gfx where toScript :: gfx -> Script
src/Graphics/Gnuplot/Private/Plot.hs view
@@ -15,6 +15,7 @@ import qualified Data.Foldable as Fold import Control.Monad (liftM2, return, ) import Data.Monoid (Monoid, mempty, mappend, )+import Data.Semigroup (Semigroup, (<>), ) import Data.Maybe (Maybe(Just, Nothing), mapMaybe, ) import Data.List (concatMap, map, (++), ) import Data.Function (($), (.), )@@ -35,14 +36,16 @@ pure :: [File graph] -> T graph pure = Cons . return +instance Semigroup (T graph) where+ Cons s0 <> Cons s1 = Cons (liftM2 (<>) s0 s1)+ {- Could also be implemented with Control.Monad.Trans.State: mappend = liftA2 mappend -} instance Monoid (T graph) where mempty = Cons $ return mempty- mappend (Cons s0) (Cons s1) =- Cons (liftM2 mappend s0 s1)+ mappend = (<>) withUniqueFile :: String -> [graph] -> T graph