optics-core-0.2: Optics as an abstract interface: core definitions
Safe HaskellNone
LanguageHaskell2010

Optics.IxAffineFold

Description

An IxAffineFold is an indexed version of an AffineFold. See the "Indexed optics" section of the overview documentation in the Optics module of the main optics package for more details on indexed optics.

Synopsis

Formation

type IxAffineFold i s a = Optic' An_AffineFold (WithIx i) s a Source #

Type synonym for an indexed affine fold.

Introduction

iafolding :: (s -> Maybe (i, a)) -> IxAffineFold i s a Source #

Create an IxAffineFold from a partial function.

Elimination

ipreview :: (Is k An_AffineFold, is `HasSingleIndex` i) => Optic' k is s a -> s -> Maybe (i, a) Source #

Retrieve the value along with its index targeted by an IxAffineFold.

ipreviews :: (Is k An_AffineFold, is `HasSingleIndex` i) => Optic' k is s a -> (i -> a -> r) -> s -> Maybe r Source #

Retrieve a function of the value and its index targeted by an IxAffineFold.

Computation

ipreview (iafolding f) ≡ f

Semigroup structure

iafailing :: (Is k An_AffineFold, Is l An_AffineFold, is1 `HasSingleIndex` i, is2 `HasSingleIndex` i) => Optic' k is1 s a -> Optic' l is2 s a -> IxAffineFold i s a infixl 3 Source #

Try the first IxAffineFold. If it returns no entry, try the second one.

Note: There is no isumming equivalent, because iasumming = iafailing.

Subtyping

data An_AffineFold :: OpticKind Source #

Tag for an affine fold.

Instances

Instances details
Is An_AffineFold A_Fold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy An_AffineFold A_Fold p -> (Constraints An_AffineFold p => r) -> Constraints A_Fold p => r Source #

Is A_Getter An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy A_Getter An_AffineFold p -> (Constraints A_Getter p => r) -> Constraints An_AffineFold p => r Source #

Is A_ReversedPrism An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy A_ReversedPrism An_AffineFold p -> (Constraints A_ReversedPrism p => r) -> Constraints An_AffineFold p => r Source #

Is An_AffineTraversal An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy An_AffineTraversal An_AffineFold p -> (Constraints An_AffineTraversal p => r) -> Constraints An_AffineFold p => r Source #

Is A_Prism An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy A_Prism An_AffineFold p -> (Constraints A_Prism p => r) -> Constraints An_AffineFold p => r Source #

Is A_Lens An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy A_Lens An_AffineFold p -> (Constraints A_Lens p => r) -> Constraints An_AffineFold p => r Source #

Is An_Iso An_AffineFold Source # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall proxy (p :: Type -> Type -> Type -> Type) r. proxy An_Iso An_AffineFold p -> (Constraints An_Iso p => r) -> Constraints An_AffineFold p => r Source #

(s ~ t, a ~ b) => ToReadOnly An_AffineFold s t a b Source # 
Instance details

Defined in Optics.ReadOnly

Methods

getting :: forall (is :: IxList). Optic An_AffineFold is s t a b -> Optic' (Join A_Getter An_AffineFold) is s a Source #

(s ~ t, a ~ b) => IxOptic An_AffineFold s t a b Source # 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic An_AffineFold is s t a b -> Optic An_AffineFold NoIx s t a b Source #