finitary-optics: Prisms and Isos between finitary types.

[ data, gpl, library ] [ Propose Tags ]

Provides convenience optics for working with finitary types. Specifically gives an Iso for inter-converting between types of the same cardinality, and a Prism for inter-converting between types of different cardinalities.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0.0
Change log CHANGELOG.md
Dependencies base (>=4.12 && <5), finitary (>=2.0.0.0 && <2.2), finite-typelits (>=0.1.4.2 && <0.2), optics-core (>=0.3 && <0.4) [details]
License GPL-3.0-or-later
Copyright (C) Koz Ross 2019
Author Koz Ross
Maintainer Sam Derbyshire
Revised Revision 2 made by sheaf at 2021-02-09T19:25:13Z
Category Data
Home page https://notabug.org/sheaf/finitary-optics
Uploaded by koz_ross at 2020-06-06T00:02:31Z
Distributions
Downloads 237 total (9 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for finitary-optics-1.0.0.0

[back to package description]

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.