{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidqnfcypmlyqvhyh6zjrlmgpowuoiwttvz2qdbexic7vrf6ghrx2i",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mlcdpkr7dcc2"
  },
  "path": "/t/ann-interval-patterns-0-8-2/14044#post_9",
  "publishedAt": "2026-05-07T22:16:37.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "closed-intervals"
  ],
  "textContent": "Congrats! Intervals are an often neglected aspect of many data analysis tasks, and hard to get right due to the many different relationships and cases. I am the author of closed-intervals which neglects the bounds details because in some applications only proper overlap is what matters.\n\nSome questions:\nWhat is the problem that `Data.Calendar` solves? What is the complexity of creating and querying calendars?\n\nHow is an instance like\n\n\n    instance (Ord x) => Ord (Interval x)\n\n\nsupposed to work lawfully, when intervals don’t form a total order? How does `Map (Interval x)` in `Layers` behave, then? Are any overlapping intervals equal? Please provide documentation and examples!\n\nHere is a suggestion to structure `Adjacency` using modal logic, which can be applied to any sets. Given any relation `r :: a -> b -> Bool` between elements, define _relation liftings_\n\n\n    forall = flip all -- supremum in the lattice Down Bool\n    exists = flip any -- infimum in the lattice Down Bool\n\n    hoare :: (a -> b -> Bool) -> Set a -> Set b -> Bool\n    hoare r a b = forall a (\\x -> exists b (\\y -> r x y))\n\n    smyth :: (a -> b -> Bool) -> Set a -> Set b -> Bool\n    smyth r a b = forall b (\\y -> exists a (\\x -> r x y))\n\n    egliMilner :: (a -> b -> Bool) -> Set a -> Set b -> Bool\n    egliMilner r a b = smyth r a b && hoare r a b\n\n\nFor example, `isSubsetOf` is modelled by `smyth (==)` and `Before` is modelled by `egliMilner (<)`.\n\nThe Hausdorff distance is also a lifting similar in structure to `egliMilner`, actually subsumes it:\n\n\n    dHaus :: (Ord distance) => (a -> a -> distance) -> Set a -> Set a -> distance\n    dHaus d a b = max (smyth' a b) (hoare' a b) where\n        smyth' a b = supremum b (\\y -> infimum a (\\x -> d x y))\n        hoare' a b = supremum a (\\x -> infimum b (\\y -> d x y))\n\n    egliMilner r = dHaus (\\x y -> Down (r x y))\n\n\nThe type `distance` could also be `Ordering`.",
  "title": "[ANN] interval-patterns-0.8.2"
}