{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigipauzz2yxcbjag6pjwk5wavj3xqrecb5lgrsm3ywuqyaj7q5eee",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mlbplqxf7ao2"
  },
  "path": "/t/ann-interval-patterns-0-8-2/14044#post_6",
  "publishedAt": "2026-05-07T15:24:46.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "I wanted to include the intervals in my `Adjacency` type in order to maintain the invariant that the arguments of the constructor of `Adjacency a` are in increasing order. This allows implementing interval operations in terms of the `adjacency`:\n\n\n    difference ::\n      forall x. (Ord x) => Interval x -> Interval x -> Maybe (OneOrTwo (Interval x))\n    difference i1 i2 = case adjacency i1 i2 of\n      Before i _ -> Just (One i)\n      Meets i _ _ -> Just (One i)\n      Overlaps i _ _ -> Just (One i)\n      Starts{} -> Nothing\n      During{} -> Nothing\n      Finishes i _ -> Just (One i)\n      Identical{} -> Nothing\n      FinishedBy{} -> Nothing\n      Contains i _ k -> Just (Two i k)\n      StartedBy _ j -> Just (One j)\n      OverlappedBy _ _ k -> Just (One k)\n      MetBy _ _ k -> Just (One k)\n      After _ j -> Just (One j)\n",
  "title": "[ANN] interval-patterns-0.8.2"
}