invert: Automatically generate a function’s inverse

[ apache, functions, library ] [ Propose Tags ]

This library deals with computing a function’s inverse. The function’s domain must be enumerable, and preferably rather small. The function’s codomain must belong to the Eq class (even better, Ord or Hashable).


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0, 1.0.0.1, 1.0.0.2, 1.0.0.3
Change log changelog.md
Dependencies base (>=4.14 && <4.18), containers (>=0.6.4 && <0.7), generic-deriving (>=1.14.1 && <1.15), hashable (>=1.3.5 && <1.5), unordered-containers (>=0.2.17 && <0.3), vector (>=0.12.3 && <0.14) [details]
License Apache-2.0
Author Chris Martin
Maintainer Chris Martin, Julie Moronuki
Category Functions
Home page https://github.com/typeclasses/invert
Bug tracker https://github.com/typeclasses/invert/issues
Uploaded by chris_martin at 2023-01-11T21:51:32Z
Distributions LTSHaskell:1.0.0.2, NixOS:1.0.0.2, Stackage:1.0.0.3
Downloads 395 total (42 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-01-11 [all 1 reports]

Readme for invert-1.0.0.3

[back to package description]

This library deals with computing a function’s inverse. This is, of course, not possible in general, so the applicability of this library comes with some caveats:

  • The function’s domain must be enumerable, and preferably rather small. We provide a few suggestions and utilities for how to enumerate the domain.

  • The function’s codomain must belong to the Eq class. An Ord or Hashable instance is also nice, to accommodate a data structure for efficient lookups.

  • The functions for inverting injections, surjections, and bijections require some care to use correctly, because the library does not verify these properties.

The main purpose of this library is to provide documentation and convenience. It does not contain a great quantity of code, so a user hesitant to incur a dependency on the package might well choose only to read and borrow its techniques.