talira

Lenses, traversals and prisms for Haskell through an abstract interface

open sourceBSD-3-Clausefree

optics is a family of Haskell packages for defining and using lenses, traversals, prisms and other optics through an abstract interface, comparable in power to lens but exploring a different design. It's split into optics-core (core definitions with few dependencies), optics-extra, optics-th (Template Haskell), optics-sop and the batteries-included optics package. It's made by Well-Typed (Adam Gundry, Andres Löh, Andrzej Rybczak and Oleg Grenrus).

Problems it solves

  • update nested records in Haskell
  • an alternative lens library for Haskell
  • focus on part of a data structure with optics in Haskell

Features

  • lenses, traversals and prisms with an abstract interface
  • optics-core with a minimal dependency footprint
  • Template Haskell generation (optics-th)
  • alternative design to lens

Alternatives

The same job

These do what optics does.

  1. lens Lenses, folds and traversals for Haskell
  2. microlens A lightweight lens library for Haskell, compatible with lens
  3. profunctors Profunctor type classes and constructions for Haskell
  4. adjunctions Adjunctions and representable functors for Haskell
  5. transformers Concrete functor and monad transformers for Haskell
  6. comonad Comonads for Haskell, the categorical dual of monads

Compare optics with the top 3