Closed Bodigrim closed 3 years ago
not really...
my guess is that you need at least 3 conditions to characterize Overlaps
, since you have to express that 4 points are in a certain order
lowerBound' a < lowerBound' b' < upperBound' a' < upperBound' b'
@marcosh could you please review bfd591ab936946ab1687416d4920dbc360bf55cf? Is my understanding correct?
@Bodigrim done, it looks good to me, I just left some minor comments which maybe could help to clarify some things
Forgive me for intruding!
If I may draw your attention to https://github.com/cigsender/interval-covers, I've been working on a very similar problem. I'd like to bring your attention to Data.Interval:167-331, where I've come up with an alternative solution to the problem of determining relative overlaps. I use four cases: NoOverlap
, Identical
, Overlapping2
, and Overlapping3
; I hadn't heard of Allen's interval algebra before coming across your package! I just wanted to highlight the edge cases of considering open or closed boundaries: when X meets Y at a twice-closed boundary, they overlap at that point.
@cigsender yep, data-interval
treats twice-closed boundaries as overlaps.
Besides data-interval
, Allen's algebra is implemented in rampart
and interval-algebra
.
Thanks @marcosh, I've incorporated some of your suggestions.
@marcosh any idea how to characterise
Overlaps
relation more concisely? https://github.com/msakai/data-interval/blob/db81d66f66c8afafe1b2636045bcff61fe8c8f6c/test/TestIntervalRelation.hs#L121-L125