Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type IxGetter i s a = Optic' A_Getter (WithIx i) s a
- ito :: (s -> (i, a)) -> IxGetter i s a
- selfIndex :: IxGetter a a a
- iview :: (Is k A_Getter, is `HasSingleIndex` i) => Optic' k is s a -> s -> (i, a)
- iviews :: (Is k A_Getter, is `HasSingleIndex` i) => Optic' k is s a -> (i -> a -> r) -> s -> r
- data A_Getter :: OpticKind
Formation
Introduction
ito :: (s -> (i, a)) -> IxGetter i s a Source #
Build an indexed getter from a function.
>>>
iview (ito id) ('i', 'x')
('i','x')
selfIndex :: IxGetter a a a Source #
Use a value itself as its own index. This is essentially an indexed version
of equality
.
Elimination
iview :: (Is k A_Getter, is `HasSingleIndex` i) => Optic' k is s a -> s -> (i, a) Source #
View the value pointed to by an indexed getter.
iviews :: (Is k A_Getter, is `HasSingleIndex` i) => Optic' k is s a -> (i -> a -> r) -> s -> r Source #
View the function of the value pointed to by an indexed getter.
Subtyping
data A_Getter :: OpticKind Source #
Tag for a getter.