{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibwn5oyxyg5gn7zct6zgz3winuayny44kfn3274okkppldsuhuqgq",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mllqn4jpse62"
  },
  "path": "/t/ann-interval-patterns-0-8-2/14044#post_19",
  "publishedAt": "2026-05-11T15:31:10.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "swaps"
  ],
  "textContent": "So `(4 :||: 0)` and `(0 :||: 4)` are treated identical. But this is only because the pattern `:||:` swaps bounds if they are not in order. I tried to mentally trace the execution in the source code of `adjacency` for the un-swapped bounds and determined the `(LT,GT)` case to match, because\n\n\n    lower i1 < lower i2 -- 2 < 4\n    upper i1 > upper i2 -- 3 > 0\n\n\nIt might be worth mentioning in the documentation that all exported patterns will swap bounds if necessary.\n\nCan you please explain what the open-open constructor pattern `:<>:` does in case the bounds are identical? The source reads almost as if `0 :<>: 0` yields a closed singleton interval, while I would expect that\n\n\n    (Leviate x) `within` (x :<>: y)\n\n\nto be always false.",
  "title": "[ANN] interval-patterns-0.8.2"
}