interval-algebra 1.2.0 → 1.3.0
raw patch · 4 files changed
+17/−1 lines, 4 filesdep +binarydep +deepseqPVP ok
version bump matches the API change (PVP)
Dependencies added: binary, deepseq
API changes (from Hackage documentation)
+ IntervalAlgebra.Core: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (IntervalAlgebra.Core.Interval a)
+ IntervalAlgebra.Core: instance Data.Binary.Class.Binary a => Data.Binary.Class.Binary (IntervalAlgebra.Core.Interval a)
+ IntervalAlgebra.PairedInterval: instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData b) => Control.DeepSeq.NFData (IntervalAlgebra.PairedInterval.PairedInterval b a)
+ IntervalAlgebra.PairedInterval: instance (Data.Binary.Class.Binary a, Data.Binary.Class.Binary b) => Data.Binary.Class.Binary (IntervalAlgebra.PairedInterval.PairedInterval b a)
Files
- ChangeLog.md +4/−0
- interval-algebra.cabal +3/−1
- src/IntervalAlgebra/Core.hs +5/−0
- src/IntervalAlgebra/PairedInterval.hs +5/−0
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for interval-algebra +## 1.3.0++* Adds `NFData` and `Binary` instances for `Interval` and `PairedInterval`+ ## 1.2.0 * Derives `Generic` instances for `Interval` and `PairedInterval`.
interval-algebra.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: interval-algebra-version: 1.2.0+version: 1.3.0 synopsis: An implementation of Allen's interval algebra for temporal logic description: Please see the README on GitHub at <https://github.com/novisci/interval-algebra> category: Algebra,Time@@ -37,6 +37,8 @@ src build-depends: base >=4.7 && <5+ , binary+ , deepseq , time >=1.8 && <2 , foldl == 1.4.12 , containers >= 0.6
src/IntervalAlgebra/Core.hs view
@@ -220,6 +220,8 @@ , addDays , diffDays ) import Control.Applicative ( Applicative(pure) )+import Data.Binary ( Binary )+import Control.DeepSeq ( NFData ) {- | An @'Interval' a@ is a pair \( (x, y) \text{ such that } x < y\). To create intervals use the @'parseInterval'@, @'beginerval'@, or @'enderval'@ functions.@@ -254,6 +256,9 @@ instance (Show a, Ord a) => Show (Interval a) where show x = "(" ++ show (begin x) ++ ", " ++ show (end x) ++ ")"++instance Binary a => Binary (Interval a)+instance NFData a => NFData (Interval a) {- | The @'Intervallic'@ typeclass defines how to get and set the 'Interval' content
src/IntervalAlgebra/PairedInterval.hs view
@@ -32,6 +32,8 @@ import safe Witherable ( Filterable(filter) ) import safe Data.Bifunctor ( Bifunctor(bimap) ) import safe GHC.Generics ( Generic )+import safe Data.Binary ( Binary )+import safe Control.DeepSeq ( NFData ) -- | An @Interval a@ paired with some other data of type @b@. newtype PairedInterval b a = PairedInterval (Interval a, b)@@ -46,6 +48,9 @@ instance Bifunctor PairedInterval where bimap f g (PairedInterval (x, y)) = PairedInterval (fmap g x, f y)++instance (NFData a, NFData b) => NFData (PairedInterval b a)+instance (Binary a, Binary b) => Binary (PairedInterval b a) -- | Defines A total ordering on 'PairedInterval b a' based on the 'Interval a' -- part.