Convenience Iso and Prism for finitary types.
Koz Ross 663685d1c2 Fix README | il y a 4 ans | |
---|---|---|
src | il y a 4 ans | |
test | il y a 4 ans | |
.gitignore | il y a 4 ans | |
.nvimrc | il y a 4 ans | |
CHANGELOG.md | il y a 4 ans | |
LICENSE.md | il y a 4 ans | |
README.md | il y a 4 ans | |
Setup.hs | il y a 4 ans | |
finitary-optics.cabal | il y a 4 ans |
finitary-optics
If a type has an instance of Finitary
, we know the type's cardinality n
, and
can convert any (non-bottom) inhabitant to a value of Finite n
. We can use
this to inter-convert between these types. This can sometimes be useful.
This library provides some optics (specifically a Prism
and an Iso
)
which help us do this kind of conversion more conveniently.
We've tested this library on GHCs 8.6.5, 8.8.3 and 8.10.1, on GNU/Linux x86_64. If you use this library on any other platforms, let us know how it goes - especially if something breaks!
This library is under the GNU General Public License, version 3 or later (SPDX
code GPL-3.0-or-later
). For more details, see the LICENSE.md
file.