[ANN] interval-patterns-0.8.2
Haskell Community [Unofficial]
May 8, 2026
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:
- One common package defining interval bounds (inclusive, exclusive, infinity)
- One package defining an interval class. Packages such as
intervalswith essentially monomorphic types implement the class. - One package defining efficient and correct algorithms on top of the interval class, akin to what parser-combinators does for applicative parsers.
- 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.Timemodule that is written in the spirit ofData.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:
(timestamp, value)might describe thatvalueis valid fromtimestamp(inclusively) until the next time stamp in the series (exclusively), if it exists, or infinity otherwise.(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 toaggregation. Parsers should therefore decode thetimestampvalue into a type that reflects the implicit interval extent.
Both examples result in collections of intervals that are non-properly overlapping, which makes sorting and storing them easier.
- 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.
Discussion in the ATmosphere