aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stdlib/source/lux/control/interval.lux32
1 files changed, 16 insertions, 16 deletions
diff --git a/stdlib/source/lux/control/interval.lux b/stdlib/source/lux/control/interval.lux
index 95a23c378..16a78e282 100644
--- a/stdlib/source/lux/control/interval.lux
+++ b/stdlib/source/lux/control/interval.lux
@@ -163,22 +163,22 @@
(def: #export (overlaps? reference sample)
(All [a] (-> (Interval a) (Interval a) Bool))
(let [(^open) reference]
- (cond (singleton? sample)
- false
+ (and (not (:: Eq<Interval> = reference sample))
+ (cond (singleton? sample)
+ false
- (singleton? reference)
- (and (>= (:: sample bottom) (:: reference bottom))
- (<= (:: sample top) (:: reference top)))
+ (singleton? reference)
+ (nested? sample reference)
- (or (and (inner? sample) (outer? reference))
- (and (outer? sample) (inner? reference)))
- (or (>= (:: reference bottom) (:: sample top))
- (<= (:: reference top) (:: sample bottom)))
-
- (inner? sample)
- (and (not (:: Eq<Interval> = reference sample))
- (inner? (intersection reference sample)))
+ (or (and (inner? sample) (outer? reference))
+ (and (outer? sample) (inner? reference)))
+ (or (>= (:: reference bottom) (:: sample top))
+ (<= (:: reference top) (:: sample bottom)))
+
+ ## both inner
+ (inner? sample)
+ (inner? (intersection reference sample))
- ## (outer? sample)
- (not (:: Eq<Interval> = reference sample))
- )))
+ ## both outer
+ (not (nested? reference sample))
+ ))))