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
- 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
Tag for a setter.
Instances
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 #