optics-core-0.1

Safe HaskellNone
LanguageHaskell2010

Optics.IxFold

Synopsis

Documentation

data A_Fold :: OpticKind #

Tag for a fold.

Instances
UnindexableOptic A_Fold # 
Instance details

Defined in Optics.Unindexed

Methods

unIx :: CheckIndices i is => Optic A_Fold is s t a b -> Optic A_Fold [] s t a b #

Is An_AffineFold A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_AffineFold A_Fold p -> (Constraints An_AffineFold p -> r) -> Constraints A_Fold p -> r

Is A_Getter A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Getter A_Fold p -> (Constraints A_Getter p -> r) -> Constraints A_Fold p -> r

Is A_PrismaticGetter A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_PrismaticGetter A_Fold p -> (Constraints A_PrismaticGetter p -> r) -> Constraints A_Fold p -> r

Is A_Traversal A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Traversal A_Fold p -> (Constraints A_Traversal p -> r) -> Constraints A_Fold p -> r

Is An_AffineTraversal A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_AffineTraversal A_Fold p -> (Constraints An_AffineTraversal p -> r) -> Constraints A_Fold p -> r

Is A_Prism A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Prism A_Fold p -> (Constraints A_Prism p -> r) -> Constraints A_Fold p -> r

Is A_Lens A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Lens A_Fold p -> (Constraints A_Lens p -> r) -> Constraints A_Fold p -> r

Is An_Iso A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Iso A_Fold p -> (Constraints An_Iso p -> r) -> Constraints A_Fold p -> r

Is An_Equality A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Equality A_Fold p -> (Constraints An_Equality p -> r) -> Constraints A_Fold p -> r

Monoid r => ViewableOptic A_Fold r # 
Instance details

Defined in Optics.Internal.View

Associated Types

type ViewResult A_Fold r :: * #

Methods

view :: Optic' A_Fold is s r -> s -> ViewResult A_Fold r #

type ViewResult A_Fold r # 
Instance details

Defined in Optics.Internal.View

type ViewResult A_Fold r = r

type IxFold i s a = Optic' A_Fold '[i] s a #

Type synonym for an indexed fold.

toIxFold :: Is k A_Fold => Optic' k '[i] s a -> IxFold i s a #

Explicitly cast an optic to an indexed fold.

ifoldMapOf :: (CheckIndices i is, Monoid r, Is k A_Fold) => Optic' k is s a -> (i -> a -> r) -> s -> r #

Fold with index via embedding into a monoid.

ifoldrOf :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> (i -> a -> r -> r) -> r -> s -> r #

Fold with index right-associatively.

ifoldlOf' :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> (i -> r -> a -> r) -> r -> s -> r #

Fold with index left-associatively, and strictly.

itoListOf :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> s -> [(i, a)] #

Fold with index to a list.

>>> itoListOf (each % ifolded) ("abc", "def")
[(0,'a'),(1,'b'),(2,'c'),(0,'d'),(1,'e'),(2,'f')]

Note: currently indexed optics can be used as non-indexed

>>> toListOf (each % ifolded) ("abc", "def")
"abcdef"

itraverseOf_ :: (CheckIndices i is, Is k A_Fold, Applicative f) => Optic' k is s a -> (i -> a -> f r) -> s -> f () #

ifolded :: FoldableWithIndex i f => IxFold i (f a) a #

Indexed fold via FoldableWithIndex class.