finitary-optics: Prisms and Isos between finitary types.

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

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]


Change log
Dependencies base (>=4.12 && <5), finitary (>= && <2.1), finite-typelits (>= && <0.2), optics-core (==0.3.*) [details]
License GPL-3.0-or-later
Copyright (C) Koz Ross 2019
Author Koz Ross
Category Data
Home page
Uploaded by koz_ross at 2020-06-06T00:01:09Z




Maintainer's Corner

For package maintainers and hackage trustees

Readme for finitary-optics-

[back to package description]


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!


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 file.