mappings: Types which represent functions k -> v

[ bsd3, data-structures, library, program ] [ Propose Tags ] [ Report a vulnerability ]

A typeclass and a number of implementations; please read README.md on github


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1.0, 0.0.2.0, 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.3.0, 0.4.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16 && <4.23), cond (>=0.5.1 && <0.6), containers (>=0.6.5 && <0.9), formatting (>=7.0.0 && <7.3), indexed-traversable (>=0.1.1 && <0.2), mappings, partialord (>=0.0.2 && <0.2), transformers (>=0.6 && <0.7), trivial-constraint (>=0.7 && <0.8) [details]
License BSD-3-Clause
Copyright 2023-26 James Cranch
Author James Cranch
Maintainer j.d.cranch@sheffield.ac.uk
Uploaded by jcranch at 2026-02-20T00:43:14Z
Category Data structures
Home page https://github.com/jcranch/mapping#readme
Bug tracker https://github.com/jcranch/mapping/issues
Source repo head: git clone https://github.com/jcranch/mapping
Distributions LTSHaskell:0.3.3.0, NixOS:0.3.3.0, Stackage:0.3.3.0
Executables view
Downloads 615 total (35 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-02-20 [all 1 reports]

Readme for mappings-0.4.0.0

[back to package description]

Mappings

This package offers a general typeclass Mapping for data structures which represent functions k -> v (possibly for fixed k, but arbitrary ordered v).

There are some fairly straightforward examples: constant mappings, and those which build up mappings where k is Either, or a pair, or Maybe, or Bool.

Three less trivial implementations are provided: