timeline: Data type representing a piecewise-constant function over time

[ bsd3, development, library ] [ Propose Tags ] [ Report a vulnerability ]

Provides data types and related function to make handling timelines easier. Please see the README on GitHub at https://github.com/bellroy/timeline


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0
Change log CHANGELOG.md
Dependencies base (>=4.14.3 && <4.21), containers (>=0.6.5 && <0.7.1), foldable1-classes-compat (>=0.1 && <0.2), hedgehog (>=1.1 && <1.6), indexed-traversable (>=0.1.2 && <0.2), template-haskell (>=2.16.0 && <2.23), text (>=1.2.4.1 && <1.3 || >=2.0 && <2.2), th-compat (>=0.1.4 && <0.2), time (>=1.9.3 && <1.15) [details]
Tested with ghc ==8.10.7 || ==9.2.8 || ==9.4.8 || ==9.6.6 || ==9.8.2 || ==9.10.1
License BSD-3-Clause
Author Bellroy Tech Team <haskell@bellroy.com>
Maintainer Bellroy Tech Team <haskell@bellroy.com>
Category Development
Source repo head: git clone https://github.com/bellroy/timeline.git
Uploaded by jack at 2024-08-22T07:35:26Z
Distributions NixOS:0.1.1.0
Downloads 132 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-08-22 [all 1 reports]

Readme for timeline-0.1.1.0

[back to package description]

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 functions
  • Data.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 tools
  • nix build build and run tests on all GHC versions we support
  • Use nix flake show to view a full list of outputs