{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiaz4tai74qm7vzvypusz3cl5p5ioqvopffk27xb4jiso75ku4u6gi",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mld6k5xfooc2"
  },
  "path": "/t/ann-interval-patterns-0-8-2/14044#post_11",
  "publishedAt": "2026-05-08T06:32:28.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "sortByRight",
    "NonNestedSeq"
  ],
  "textContent": "mixphix:\n\n> It seems simpler to me, this way, than translating `hoare` and `smyth` into the language of `Interval`s that this library uses.\n\nOf course there must be a shortcut for intervals over general sets. I only mentioned it because in some situations, users might not wish to distinguish between all constructors of `Adjacency`, but instead question a modality, such as “Is there a point within `x` that is less than/greater than all points in `y`?” that is witnessed by more than one constructor.\n\nmixphix:\n\n> which is indeed `EQ` on `Identical` intervals.\n\nSo `compare i1 i1 == EQ` if and only if `adjacency i1 i2 == Identical i1`?, Which of the other 12 cases of `Adjacency` count as `LT` and which as `GT`, then? Does the `Ord` instance satisfy reflexivity, transitivity and antisymmetry? I see no tests regarding that.\n\nmixphix:\n\n> The `nestingsAsc` function combines overlapping intervals in such a way that the resulting list is disjoint and also sorted according to this order.\n\nBut you do have to take into account that the behaviour of `Data.Map` (used in `Layers`) is undefined if used with a type that has a non-lawful `Ord` instance. Nasty bugs can arise, such as\n\n  * inserts unexpectedly dropping elements\n  * look-ups not turning up elements that are present\n\n\n\nIn `closed-intervals` I implemented an interval tree, which decorates each internal node with the convex hull of the sub-tree. You might also want to take a look at sortByRight and and NonNestedSeq which is a simple search structure that works correctly given a certain nesting assumption.",
  "title": "[ANN] interval-patterns-0.8.2"
}