MyNixOS website logo
Description

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 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.
Metadata

Version

0.1.1.0

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows