interval-algebra 0.10.0 → 0.10.1
raw patch · 4 files changed
+21/−4 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- IntervalAlgebra.IntervalUtilities: gapsWithin :: (Applicative f, Witherable f, Monoid (f (Interval a)), Monoid (f (Maybe (Interval a))), IntervalSizeable a b, IntervalCombinable i0 a, IntervalCombinable i1 a) => i0 a -> f (i1 a) -> Maybe (f (Interval a))
+ IntervalAlgebra.IntervalUtilities: gapsWithin :: (Applicative f, Witherable f, Monoid (f (Interval a)), Monoid (f (Maybe (Interval a))), IntervalSizeable a b, Intervallic i0 a, IntervalCombinable i1 a) => i0 a -> f (i1 a) -> Maybe (f (Interval a))
Files
- ChangeLog.md +4/−0
- interval-algebra.cabal +1/−1
- src/IntervalAlgebra.hs +13/−1
- src/IntervalAlgebra/IntervalUtilities.hs +3/−2
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for interval-algebra +## 0.10.1++* Replaces unnecessary `IntervalCombinable i0 a` constraint in `gapsWithin` with `Intervallic i0 a`.+ ## 0.10.0 * Adds `diffFromBegin` (`diffFromEnd`) functions (not totally satisfied with these names) which change the reference point of the interval in the second argument by the difference from the `begin` (`end`) of the interval in the first argument.
interval-algebra.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: interval-algebra-version: 0.10.0+version: 0.10.1 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
src/IntervalAlgebra.hs view
@@ -648,6 +648,12 @@ -- | Modifies the endpoints of second argument's interval by taking the difference -- from the first's input's 'begin'. +-- >>> diffFromBegin (Interval ((5::Int), 6)) (Interval (10, 15))+-- (5, 10)+--+-- >>> diffFromBegin (Interval ((1::Int), 2)) (Interval (3, 15))+-- (2, 14)+-- diffFromBegin :: ( IntervalSizeable a b , Functor i1 , Intervallic i0 a ) => @@ -655,7 +661,13 @@ diffFromBegin i = fmap (`diff` begin i) -- | Modifies the endpoints of second argument's interval by taking the difference--- from the first's input's 'end'. +-- from the first's input's 'end'.+-- >>> diffFromEnd (Interval ((5::Int), 6)) (Interval (10, 15))+-- (4, 9)+--+-- >>> diffFromEnd (Interval ((1::Int), 2)) (Interval (3, 15))+-- (1, 13)+-- diffFromEnd :: ( IntervalSizeable a b , Functor i1 , Intervallic i0 a ) =>
src/IntervalAlgebra/IntervalUtilities.hs view
@@ -278,12 +278,13 @@ -- -- >>> gapsWithin (iv 9 1) [iv 5 0, iv 2 7, iv 3 12] -- Just [(5, 7),(9, 10)]+-- gapsWithin :: ( Applicative f , Witherable f , Monoid (f (Interval a)) , Monoid (f (Maybe (Interval a))) , IntervalSizeable a b- , IntervalCombinable i0 a+ , Intervallic i0 a , IntervalCombinable i1 a ) => i0 a -- ^ i@@ -525,7 +526,7 @@ FinishedBy -> foldMeeting $ Meeting [ evp b1 b2 s1, ev i2 sc ] Contains -> foldMeeting $ Meeting [ evp b1 b2 s1, evp b2 e2 sc, evp e2 e1 s1 ] Starts -> foldMeeting $ Meeting [ ev i1 sc, evp e1 e2 s2 ]- _ -> Meeting [ ev i1 sc ] {- Equals case -}+ _ -> Meeting [ ev i1 sc ] {- Equals case -} where x = min o e y = max o e i1 = getInterval x