Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data A_Fold :: OpticKind
- type IxFold i s a = Optic' A_Fold '[i] s a
- toIxFold :: Is k A_Fold => Optic' k '[i] s a -> IxFold i s a
- ifoldMapOf :: (CheckIndices i is, Monoid r, Is k A_Fold) => Optic' k is s a -> (i -> a -> r) -> s -> r
- ifoldrOf :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> (i -> a -> r -> r) -> r -> s -> r
- ifoldlOf' :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> (i -> r -> a -> r) -> r -> s -> r
- itoListOf :: (CheckIndices i is, Is k A_Fold) => Optic' k is s a -> s -> [(i, a)]
- 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
- module Optics.Optic
Documentation
Tag for a fold.
Instances
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.
module Optics.Optic