refined-containers: Type-checked proof that a key exists in a container and can be safely indexed.

[ data, library, mit ] [ Propose Tags ]

This package defines ways to prove that a key exists in an associative container such as a Map, IntMap, or HashMap; so that the key can be used to index into the map without a Maybe or manually handling the "impossible" case with error or other partial functions.

To do this, the containers are tagged with a type parameter that identifies their set of keys, so that if you have another container with the same parameter, you know it has the same keys.

There is also a type of keys that have been proven to exist in such containers -- a refinement type. They are also tagged with a type parameter. If the type parameter of the key matches that of the container, indexing is guaranteed to proceed without failure.

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Dependencies adjunctions (>=4.4 && <4.5), base (>=4.12 && <4.20), constraints (>=0.11 && <0.15), containers (>=0.5.7 && <0.8), deepseq (>=1.4 && <1.6), distributive (>=0.5.3 && <0.7), hashable (>=1.2.7 && <1.5), indexed-traversable (>=0.1 && <0.2), mtl (>=2.2.2 && <2.4), refined (>=0.5 && <0.9), reflection (>=2 && <2.2), unordered-containers (>=0.2.11 && <0.3) [details]
License MIT
Author mniip@typeable.io
Maintainer mniip@typeable.io
Category Data
Source repo head: git clone https://github.com/typeable/refined-containers/
Uploaded by typeable at 2023-12-21T14:39:49Z
Distributions NixOS:0.1.0.1
Downloads 64 total (10 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-12-21 [all 1 reports]