External Publication
Visit Post

[ANN] interval-patterns-0.8.2

Haskell Community [Unofficial] May 11, 2026
Source

Good point: The interval-using community should discuss what uses there are for “non-normalized” intervals, as you call them, and how libraries should treat them. Guarding every function against lower x > upper x can lead to complicated interfaces, silent bugs or run-time crashes, depending on the choice of the library author. In what circumstances is it suitable to keep computing with such an interval and what operations still turn up sensible results? For example, concerning overlap queries any such interval could be regarded as either the empty set (see Python ranges) or as the disjoint union of two rays. It seems that @mixphix calculates

adjacency (interval 2 3) i2@(interval 4 0) =
  Contains (interval 2 4) i2 (interval 0 3)

which I have a hard time interpreting because there is no documentation for the three arguments of Contains.

Discussion in the ATmosphere

Loading comments...