Convenience Iso and Prism for finitary types.

sheaf c3868a3a2c Ensure GHC 9.0 compatibility 3 years ago
src c3868a3a2c Ensure GHC 9.0 compatibility 3 years ago
test 977bf0f0fa Init 4 years ago
.gitignore 977bf0f0fa Init 4 years ago
.nvimrc 977bf0f0fa Init 4 years ago
CHANGELOG.md 977bf0f0fa Init 4 years ago
LICENSE.md 977bf0f0fa Init 4 years ago
README.md 663685d1c2 Fix README 4 years ago
Setup.hs 977bf0f0fa Init 4 years ago
finitary-optics.cabal c3868a3a2c Ensure GHC 9.0 compatibility 3 years ago

README.md

finitary-optics

What's this all about, then?

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.

Sounds good! Can I use it?

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!

License

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.