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

[ data, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

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, 0.1.0.2
Dependencies adjunctions (>=4.4 && <4.5), base (>=4.12 && <4.21), 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.6), 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]
Tested with ghc ==9.10.1, ghc ==9.8.2, ghc ==9.6.6, ghc ==9.4.8, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.6.5
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 mniip at 2024-11-18T04:40:00Z
Distributions NixOS:0.1.0.1
Downloads 136 total (3 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-11-18 [all 1 reports]