{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihdkdkbgm2rq2dbamf4jipenqh4nmswud7x453xigp2k7g526wxhq",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mld6kj4i4sr2"
},
"path": "/t/ann-interval-patterns-0-8-2/14044#post_12",
"publishedAt": "2026-05-08T07:03:24.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"parser-combinators",
"@mchav"
],
"textContent": "I propose all authors of interval packages should get together and see if we can re-factor the Haskell interval ecosystem into thoroughly tested parts that can be used across several packages. For example:\n\n * One common package defining interval bounds (inclusive, exclusive, infinity)\n * One package defining an interval class. Packages such as `intervals` with essentially monomorphic types implement the class.\n * One package defining efficient and correct algorithms on top of the interval class, akin to what parser-combinators does for applicative parsers.\n * Perhaps a package or classes dedicated solely to time intervals is warranted. For example, I often work with time intervals of statically known length and therefore have a `Data.Interval.Time` module that is written in the spirit of `Data.Fixed`. This could become a part of @mchav 's dataframe effort, since data that is annotated with time types in reality often refers to intervals of time. Examples from the wild:\n\n\n 1. `(timestamp, value)` might describe that `value` is valid from `timestamp` (inclusively) until the next time stamp in the series (exclusively), if it exists, or infinity otherwise.\n 2. `(timestamp, aggregation)` might indicate that the integral/average/maximum/minimum of a time-varying value over an interval `(timestamp,timestamp+implicitLength)` resp. `(timestamp-implicitLength, timestamp)` is equal to `aggregation`. Parsers should therefore decode the `timestamp` value into a type that reflects the implicit interval extent.\n\n\n\nBoth examples result in collections of intervals that are non-properly overlapping, which makes sorting and storing them easier.\n\n * The residue each author remains responsible for will then be special data structures for storing collections of intervals and/or algorithms for interval types that have additional properties, such as calendaric events or intervals of numeric values.\n\n",
"title": "[ANN] interval-patterns-0.8.2"
}