optics
Optics as an abstract interface
Version on this page: | 0.4.2 |
LTS Haskell 22.39: | 0.4.2.1@rev:1 |
Stackage Nightly 2024-10-31: | 0.4.2.1@rev:1 |
Latest on Hackage: | 0.4.2.1@rev:1 |
optics-0.4.2@sha256:864b8a1370dfe8e23137901ef665ac871120b5092d15803697efda7de6362c47,7560
Module documentation for 0.4.2
This package makes it possible to define and use Lenses, Traversals, Prisms
and other optics, using an abstract interface. See the main module Optics
for the documentation.
This is the "batteries-included" variant with many dependencies; see the
optics-core
package and
other optics-*
dependencies if you need a more limited dependency footprint.
Note: Hackage does not yet display documentation for reexported-modules,
but you can start from the Optics
module documentation or see the module
list in optics-core
.
Changes
optics-0.4.2 (2022-05-19)
-
Allow
transformers-0.6
andmtl-2.3
Note that
optics-extra
no longer definesZoom
instances forErrorT
orListT
when building withmtl-2.3
or later. This is becauseMonadState
is a superclass ofZoom
, and theMonadState
instances forErrorT
andListT
were removed inmtl-2.3
. Be watchful of this if you buildoptics-extra
withmtl-2.3
(or later) combined with an older version oftransformers
(pre-0.6) that definesErrorT
orListT
. Similarly forMagnify
andMagnifyMany
.
optics-0.4.1 (2022-03-22)
- Add support for GHC-9.2
- Add
is
(#410) - Improve error messages related to the
JoinKinds
class (#439) - Port
universeOf
,cosmosOf
,paraOf
,rewriteOf
,transformOf
,rewriteMOf
andtransformMOf
fromControl.Lens.Plated
(#379) - Add
(%?)
composition operator (#434)
optics-0.4 (2021-02-22)
- See migration-guide-0.4.md for more details
- Add support for GHC-9.0
- Drop support for GHC-8.0
- The
FunctorWithIndex
,FoldableWithIndex
andTraversableWithIndex
type classes have been migrated to a new package,indexed-traversable
(#370) - Add
adjoin
,iadjoin
andboth
toOptics.[Ix]Traversal
(#332, #372) - Add
ifst
andisnd
toOptics.IxLens
(#389) - Generalize types of
generic
(#376) - Make
chosen
an indexed lens to see which value is traversed (#335) - Remove
GeneralLabelOptic
extensibility mechanism (#361) - Add
gfield
,gafield
,gconstructor
,gposition
andgplate
for generics-based data access (#358, #361) - Add support for generics-based field lenses and constructor prisms (
gfield
andgconstructor
) toLabelOptic
so they can be used viaOverloadedLabels
(#361) - Remove unnecessary INLINE pragmas to reduce compile times (#394)
- Simplify the type of
(%)
using newJoinKinds
andAppendIndices
classes in place of theJoin
andAppend
type families (#397, #399) - Print missing language extensions during TH generation of labels if there are any (#352)
- Add support for getters of rank1 polymorphic fields to optics generated with
the
makeFieldLabels
family of functions (#365) - Extend support of type-changing optics generated with the
makeFieldLabels
family to type parameters that are phantom and applied to non-injective type families (#365) - Fix TH generation of optics for poly-kinded data families (#378)
- Fix
declareFieldLabels
when a field type refers to a type defined in the same quote (#380)
optics-0.3 (2020-04-15)
- GHC-8.10 support
- Add
filteredBy
andunsafeFilteredBy
- Add
FunctorWithIndex
,FoldableWithIndex
andTraversableWithIndex
instances forConst
andConstant
- Add
afoldVL
andiafoldVL
constructors - Rename
toAtraversalVL
toatraverseOf
, andtoIxAtraversalVL
toiatraverseOf
- Generalise
element
andelementOf
to constructIxAffineTraversal
s instead ofIxTraversal
s - Change
mapping
to work on optic kinds other thanIso
: it now supportsLens
andPrism
degenerating toGetter
andReview
respectively - Generalise
ignored
to be anIxAffineTraversal
instead of anIxTraversal
- Add
singular
andisingular
- Add
(^?!)
operator - Expose
Curry
andCurryCompose
- Show expected elimination forms on optic kind mismatch
- Use stricter
uncurry
for better performance - Add hidden
LabelOptic
instance to postpone instance resolution - Add
GeneralLabelOptic
for pluggable generic optics as labels - Document monoidal structures of
Fold
s - Remove proxy argument from
implies
- Add
itoList
- Improvements to TH-generated optics:
LabelOptic
instances make optic kind a type equality for better type inferenceLabelOptic
instances for field optics work properly in the presence of type families- Fixed calculation of phantom types in
LabelOptic
prism instances - Better support for generating optics in the presence of kind polymorphism
optics-0.2 (2019-10-18)
- Add
non
,non'
andanon
toOptics.Iso
ix
can produce optic kinds other thanAffineTraversal
- Generalise type of
generic1
- Move
use
fromOptics.View
toOptics.State
and restrict its type - Add
preuse
toOptics.State
- Rename
use
,uses
,listening
andlistenings
to reflect the fact that they haveViewResult
-generalised types - Add
noPrefixFieldLabels
andnoPrefixNamer
toOptics.TH
- Move some internal definitions out to new
indexed-profunctors
package - Introduce
OpticKind
andIxList
type synonyms for better type inference - Make
itraverse
forSeq
faster forcontainers >= 0.6.0
- Assorted documentation improvements
optics-0.1 (2019-09-02)
- Initial release