Data type representing a piecewise-constant function over time.
Provides data types and related function to make handling timelines easier. Please see the README on GitHub at https://github.com/bellroy/timeline
timeline
Motivation
The world is always changing, and often we want to manage the changes of data using computers. Below are some concrete examples:
- Employee data such as compensation, city, tax rule, time-off, etc.
- Prices of products. A product could have different prices on Amazon and EBay, and in different currencies.
Timeline data is often implemented by attaching extra fields to your business object, denoting the start and end time of each interval. However, only representing and storing the data is not sufficient, we need to run operations on timeline data, like extracting a single data point at some specific time, merging multiple timelines together, etc.
If you have a similar use case and don't want to reinvent the wheel, this library is for you.
Module Organization
Data.Timeline
essential types and functionsData.Timeline.Hedgehog
hedgehog generators for timeline types
Getting Started
The core type is Timeline a
, refer to Haddock for its usage.
Contribution
Bellroy actively maintains this project. Feel free to submit issues and pull requests!
The code is formatted with ormolu
If you use Nix:
nix develop
enter a shell with all necessary toolsnix build
build and run tests on all GHC versions we support- Use
nix flake show
to view a full list of outputs.