Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type IxSetter i s t a b = Optic A_Setter (WithIx i) s t a b
- type IxSetter' i s a = Optic' A_Setter (WithIx i) s a
- isets :: ((i -> a -> b) -> s -> t) -> IxSetter i s t a b
- iover :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> a -> b) -> s -> t
- imapped :: FunctorWithIndex i f => IxSetter i (f a) (f b) a b
- iset :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> b) -> s -> t
- iset' :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> b) -> s -> t
- iover' :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> a -> b) -> s -> t
- data A_Setter :: OpticKind
- class Functor f => FunctorWithIndex i f | f -> i where
- imap :: (i -> a -> b) -> f a -> f b
Formation
type IxSetter i s t a b = Optic A_Setter (WithIx i) s t a b Source #
Type synonym for a type-modifying indexed setter.
type IxSetter' i s a = Optic' A_Setter (WithIx i) s a Source #
Type synonym for a type-preserving indexed setter.
Introduction
isets :: ((i -> a -> b) -> s -> t) -> IxSetter i s t a b Source #
Build an indexed setter from a function to modify the element(s).
Elimination
iover :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> a -> b) -> s -> t Source #
Apply an indexed setter as a modifier.
Computation
Well-formedness
Additional introduction forms
imapped :: FunctorWithIndex i f => IxSetter i (f a) (f b) a b Source #
Indexed setter via the FunctorWithIndex
class.
iover
imapped
≡imap
Additional elimination forms
iset' :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> b) -> s -> t Source #
Apply an indexed setter, strictly.
iover' :: (Is k A_Setter, is `HasSingleIndex` i) => Optic k is s t a b -> (i -> a -> b) -> s -> t Source #
Apply an indexed setter as a modifier, strictly.
Subtyping
data A_Setter :: OpticKind Source #
Tag for a setter.
Instances
Is A_Traversal A_Setter Source # | |
Defined in Optics.Internal.Optic.Subtyping implies :: (Constraints A_Traversal p -> r) -> Constraints A_Setter p -> r Source # | |
Is An_AffineTraversal A_Setter Source # | |
Defined in Optics.Internal.Optic.Subtyping implies :: (Constraints An_AffineTraversal p -> r) -> Constraints A_Setter p -> r Source # | |
Is A_Prism A_Setter Source # | |
Defined in Optics.Internal.Optic.Subtyping implies :: (Constraints A_Prism p -> r) -> Constraints A_Setter p -> r Source # | |
Is A_Lens A_Setter Source # | |
Defined in Optics.Internal.Optic.Subtyping implies :: (Constraints A_Lens p -> r) -> Constraints A_Setter p -> r Source # | |
Is An_Iso A_Setter Source # | |
Defined in Optics.Internal.Optic.Subtyping implies :: (Constraints An_Iso p -> r) -> Constraints A_Setter p -> r Source # | |
IxOptic A_Setter s t a b Source # | |
Defined in Optics.Indexed.Core |
Re-exports
class Functor f => FunctorWithIndex i f | f -> i where Source #
Class for Functor
s that have an additional read-only index available.
Nothing
imap :: (i -> a -> b) -> f a -> f b Source #
imap :: TraversableWithIndex i f => (i -> a -> b) -> f a -> f b Source #