Safe Haskell | None |
---|---|
Language | Haskell2010 |
Optics.Getter
Description
A Getter
is simply a function considered as an Optic
.
Given a function f :: S -> A
, we can convert it into a
using Getter
S Ato
, and convert back to a function using view
.
This is typically useful not when you have functions/Getter
s
alone, but when you are composing multiple Optic
s to produce a
Getter
.
Formation
Introduction
Elimination
views :: Is k A_Getter => Optic' k is s a -> (a -> r) -> s -> r Source #
View the function of the value pointed to by a getter.
Computation
Well-formedness
A Getter
is not subject to any laws.
Subtyping
data A_Getter :: OpticKind Source #
Tag for a getter.
Instances
ReversibleOptic A_Getter Source # | |
Defined in Optics.Re Associated Types type ReversedOptic A_Getter = (r :: Type) Source # Methods re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_Getter is s t a b -> Optic (ReversedOptic A_Getter) is b a t s Source # | |
Is A_Getter A_Fold Source # | |
Defined in Optics.Internal.Optic.Subtyping Methods implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints A_Fold p => r Source # | |
Is A_Getter An_AffineFold Source # | |
Defined in Optics.Internal.Optic.Subtyping Methods implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints An_AffineFold p => r Source # | |
Is A_ReversedPrism A_Getter Source # | |
Defined in Optics.Internal.Optic.Subtyping Methods implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints A_Getter p => r Source # | |
Is A_Lens A_Getter Source # | |
Defined in Optics.Internal.Optic.Subtyping Methods implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Getter p => r Source # | |
Is An_Iso A_Getter Source # | |
Defined in Optics.Internal.Optic.Subtyping Methods implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Getter p => r Source # | |
(s ~ t, a ~ b) => ToReadOnly A_Getter s t a b Source # | |
(s ~ t, a ~ b) => IxOptic A_Getter s t a b Source # | |
(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_Getter f g s t a b Source # |
|
Defined in Optics.Mapping Associated Types type MappedOptic A_Getter Source # Methods mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_Getter is s t a b -> Optic (MappedOptic A_Getter) is (f s) (g t) (f a) (g b) Source # | |
type ReversedOptic A_Getter Source # | |
Defined in Optics.Re | |
type MappedOptic A_Getter Source # | |
Defined in Optics.Mapping |