| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Optic.Getter
Contents
Description
The getter and its mirror the review: the one-leg optics s (~> aGetterRes /
getP) and b (its ~> tFlip). A getter is an affine fold that always succeeds; a review
is what remains of a prism's build leg. Build them from a single morphism with to / unto,
and eliminate with view / (^.) and review / (#), via the /RepCorepConstant carriers.
Synopsis
- class AffineFoldRes p q => GetterRes (p :: k +-> k) (q :: j +-> j) where
- type Getter (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Prostrong (GetterRes :: (k +-> k) -> (j +-> j) -> Constraint)) s t a b
- view :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Ob a => c (Rep (Constant a))) => Optic c s t a b -> s ~> a
- (^.) :: forall (c :: (Type -> Type -> Type) -> Constraint) a s t b. c (Rep (Constant a)) => s -> Optic c s t a b -> a
- to :: forall {k} {j} (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf k, CategoryOf j, Ob b, Ob t) => (s ~> a) -> Getter s t a b
- type Review (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Prostrong (Flip (GetterRes :: (j +-> j) -> (k +-> k) -> Constraint))) s t a b
- review :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Ob b => c (Corep (Constant b))) => Optic c s t a b -> b ~> t
- (#) :: forall (c :: (Type -> Type -> Type) -> Constraint) b s t a. c (Corep (Constant b)) => Optic c s t a b -> b -> t
- unto :: forall {k} {j} (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf k, CategoryOf j, Ob s, Ob a) => (b ~> t) -> Review s t a b
Documentation
class AffineFoldRes p q => GetterRes (p :: k +-> k) (q :: j +-> j) where Source Github #
Instances
| (CategoryOf k, CategoryOf j) => GetterRes (Id :: k -> k -> Type) (Id :: j -> j -> Type) Source Github # | |
| (CategoryOf k, CategoryOf j) => GetterRes (Id :: k -> k -> Type) (TerminalProfunctor :: j -> j -> Type) Source Github # | |
| Comonoid m => GetterRes (LensW m :: k -> k -> Type) (CoLensW m :: k -> k -> Type) Source Github # | |
| (HasCoproducts k, Ob t) => GetterRes (Corep (Coproduct t) :: k -> k -> Type) (Rep (Coproduct t) :: k -> k -> Type) Source Github # | |
| (HasBinaryProducts k, Ob s) => GetterRes (Rep (Product s) :: k -> k -> Type) (Corep (Product s) :: k -> k -> Type) Source Github # | |
| (GetterRes f g, GetterRes f' g') => GetterRes (f :.: f' :: k -> k -> Type) (g' :.: g :: j -> j -> Type) Source Github # | |
type Getter (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Prostrong (GetterRes :: (k +-> k) -> (j +-> j) -> Constraint)) s t a b Source Github #
view :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Ob a => c (Rep (Constant a))) => Optic c s t a b -> s ~> a Source Github #
(^.) :: forall (c :: (Type -> Type -> Type) -> Constraint) a s t b. c (Rep (Constant a)) => s -> Optic c s t a b -> a infixl 8 Source Github #
View the focus of a concrete, Type-level optic.
to :: forall {k} {j} (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf k, CategoryOf j, Ob b, Ob t) => (s ~> a) -> Getter s t a b Source Github #
type Review (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Prostrong (Flip (GetterRes :: (j +-> j) -> (k +-> k) -> Constraint))) s t a b Source Github #
review :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Ob b => c (Corep (Constant b))) => Optic c s t a b -> b ~> t Source Github #
Review through any optic that can act as a review, in either encoding.
(#) :: forall (c :: (Type -> Type -> Type) -> Constraint) b s t a. c (Corep (Constant b)) => Optic c s t a b -> b -> t infixr 8 Source Github #
Review through a concrete, Type-level optic.
unto :: forall {k} {j} (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf k, CategoryOf j, Ob s, Ob a) => (b ~> t) -> Review s t a b Source Github #
Orphan instances
| (CategoryOf j, CategoryOf k, Ob b, SubFlavor w (Flip (GetterRes :: (j +-> j) -> (k +-> k) -> Constraint))) => Prostrong (w :: FLAVOR j k) (Corep (Constant b) :: k -> j -> Type) Source Github # | The reviewing dual of the bridge above, over the carrier |
| (CategoryOf j, CategoryOf k, Ob a, SubFlavor w (GetterRes :: (k +-> k) -> (j +-> j) -> Constraint)) => Prostrong (w :: FLAVOR j k) (Rep (Constant a) :: k -> j -> Type) Source Github # | Any flavor whose optics can view has strength for the viewing carrier |