The optics family of Haskell
packages make it possible to define and use Lenses, Traversals, Prisms and other
optics, using an abstract interface. They are roughly comparable in
functionality with the lens
package, but explore a different part of the design space. For a detailed
introduction, see the Haddocks for the main Optics
module.
The authors of the optics family of packages are:
- Adam Gundry
- Andres Löh
- Andrzej Rybczak
- Oleg Grenrus
Our thanks go to those who have (involuntarily) contributed code and ideas to
optics. In particular, we have liberally reused parts of the lens package by
Edward Kmett and contributors.
-
opticsis a "batteries-included" package with many dependencies. It incorporates:-
optics-core: core definitions with a minimal dependency footprint. -
optics-extra: extra definitions and instances that extendoptics-core, incurring dependencies on various boot library packages. -
optics-th: machinery to construct optics usingTemplateHaskell. -
indexed-profunctors: internal definitions of indexed profunctor representation.
-
-
optics-vl: utilities for compatibility with van Laarhoven isomorphisms and prisms, as defined in thelenslibrary. This package is not included inopticsas it imposes a dependency onprofunctors. Note thatoptics-corealready supports conversion for van Laarhoven lenses and various other optics. -
template-haskell-optics: optics for working with types in thetemplate-haskellpackage (seeoptics-thfor usingTemplateHaskellto construct optics).
These packages have not (yet) been officially released. If you find them useful, we would welcome offers to maintain these packages.
optics-sop: generic construction of optics using thegenerics-soppackage, and optics forgenerics-soptypes.
These packages are for internal use only, and are not intended to be released:
-
metametapost: generates diagrams used in the documentation, and an example of usingoptics. -
optics-codegen: code generator for theIsclass andJointype family used internally byoptics.