External Publication
Visit Post

[ANN] interval-patterns-0.8.2

Haskell Community [Unofficial] May 8, 2026
Source

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 intervals with 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.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:
  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.
  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.

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

Loading comments...