| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Optic
Description
The encoding-agnostic core of the optics machinery: the Optic type (a rank-2 profunctor
transformation forall p. c p => p a b -> p s t), optic flavors as witness-pair constraints
(FLAVOR) with subtyping via flavor superclasses, carrier strength (Prostrong), and the existential
encoding ExOptic with ex2prof/prof2ex/convert mediating between the two. Also home to
the flavor-generic combinators iso, re and (%). The concrete optic kinds live in the
Proarrow.Optic.* submodules, and the user-facing vocabulary (with the full subtyping lattice
drawn out) is re-exported from Proarrow.Optics.
Synopsis
- data OPTIC j k (c :: (j +-> k) -> Constraint) = OPT k j
- type family OptL (p :: OPTIC j k c) :: k where ...
- type family OptR (p :: OPTIC j k c) :: j where ...
- data Optic_ (ab :: OPTIC j k c) (st :: OPTIC j k c) where
- type Optic (c :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) = Optic_ ('OPT a b :: OPTIC j k c) ('OPT s t :: OPTIC j k c)
- type Optic' (c :: (j +-> j) -> Constraint) (s :: j) (a :: j) = Optic c s s a a
- (%) :: forall {j} {k} (c1 :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) (c2 :: (j +-> k) -> Constraint) (c :: k) (d :: j). Optic c1 s t a b -> Optic c2 a b c d -> Optic (c1 :&&: c2) s t c d
- type PIso (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Profunctor :: (j +-> k) -> Constraint) s t a b
- type PIso' (s :: j) (a :: j) = PIso s s a a
- iso :: forall {j} {k} (c :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k) => (s ~> a) -> (b ~> t) -> Optic c s t a b
- type FLAVOR j k = (k +-> k) -> (j +-> j) -> Constraint
- class (forall (f :: k +-> k) (f' :: j +-> j) (g :: k +-> k) (g' :: j +-> j). (w f f', w g g') => w (f :.: g) (g' :.: f'), w (Id :: k -> k -> Type) (Id :: j -> j -> Type)) => Flavor (w :: FLAVOR j k) where
- class Sub (w :: FLAVOR j k) (p :: k +-> k) (q :: j +-> j) where
- sub :: (w p q => r) -> r
- class (Profunctor p, CategoryOf j, CategoryOf k) => Prostrong (w :: FLAVOR j k) (p :: j +-> k) where
- proact :: forall (f :: k +-> k) (g :: j +-> j). (w f g, Profunctor f, Profunctor g) => ((f :.: p) :.: g) :~> p
- data ExOptic (w :: FLAVOR j k) (a :: k) (b :: j) (s :: k) (t :: j) where
- ExOptic :: forall {j} {k} {w :: FLAVOR j k} (p :: k +-> k) (q :: j +-> j) (s :: k) (t :: j) (a :: k) (b :: j). (w p q, Profunctor p, Profunctor q) => p s a -> q b t -> ExOptic w a b s t
- legs2prof :: forall {j} {k} (w :: FLAVOR j k) p q (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, w p q, Profunctor p, Profunctor q) => p s a -> q b t -> Optic (Prostrong w) s t a b
- ex2prof :: forall {j} {k} {w :: FLAVOR j k} (a :: k) (b :: j) (s :: k) (t :: j). (CategoryOf j, CategoryOf k) => ExOptic w a b s t -> Optic (Prostrong w) s t a b
- prof2ex :: forall {j} {k} (w :: FLAVOR j k) (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> ExOptic w a b s t
- withLegs :: forall {j} {k} w (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) r. (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> (forall (p :: k +-> k) (q :: j +-> j). (w p q, Profunctor p, Profunctor q) => p s a -> q b t -> r) -> r
- convert :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (w :: FLAVOR j k) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> Optic (Prostrong w) s t a b
- data Re (p :: k -> k1 -> Type) (s :: k1) (t :: k) (a :: k1) (b :: k) where
- class (forall (p :: k +-> j) (a :: k) (b :: j). coc p => c (Re p a b)) => ReversibleOptic (c :: (j +-> k) -> Constraint) (coc :: (k +-> j) -> Constraint) | c -> coc
- re :: forall {j} {k} (a :: j) (b :: k) (c :: (k +-> j) -> Constraint) (coc :: (j +-> k) -> Constraint) (s :: j) (t :: k). (Ob a, Ob b, ReversibleOptic c coc) => Optic c s t a b -> Optic coc b a t s
- class w p q => Flip (w :: k -> k1 -> Constraint) (q :: k1) (p :: k)
- class c (Op q) => OpConstraint (c :: (OPPOSITE j -> OPPOSITE k -> Type) -> Constraint) (q :: j +-> k)
- class w (Op g) (Op f) => OpFlavor (w :: (OPPOSITE j -> OPPOSITE k -> Type) -> (OPPOSITE j1 -> OPPOSITE k1 -> Type) -> Constraint) (f :: j1 +-> k1) (g :: j +-> k)
- opOptic :: forall {j} {k} (c :: (OPPOSITE k -> OPPOSITE j -> Type) -> Constraint) (s :: j) (t :: k) (a :: j) (b :: k). (forall (p :: OPPOSITE j +-> OPPOSITE k). c p => c (Op (UnOp p)), CategoryOf j, CategoryOf k) => Optic (OpConstraint c) s t a b -> Optic c ('OP t) ('OP s) ('OP b) ('OP a)
- unOpOptic :: forall {j} {k} (c :: (OPPOSITE k +-> OPPOSITE j) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). Optic c ('OP t) ('OP s) ('OP b) ('OP a) -> Optic (OpConstraint c) s t a b
Documentation
data OPTIC j k (c :: (j +-> k) -> Constraint) Source Github #
Constructors
| OPT k j |
Instances
| (CategoryOf j, CategoryOf k) => CategoryOf (OPTIC j k c) Source Github # | Optics form a category: an object |
Defined in Proarrow.Optic | |
| (CategoryOf j, CategoryOf k) => Promonad (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # | |
| (CategoryOf j, CategoryOf k) => Profunctor (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # | |
Defined in Proarrow.Optic Methods dimap :: forall (c0 :: OPTIC j k c) (a :: OPTIC j k c) (b :: OPTIC j k c) (d :: OPTIC j k c). (c0 ~> a) -> (b ~> d) -> Optic_ a b -> Optic_ c0 d Source Github # lmap :: forall (c0 :: OPTIC j k c) (a :: OPTIC j k c) (b :: OPTIC j k c). (c0 ~> a) -> Optic_ a b -> Optic_ c0 b Source Github # rmap :: forall (b :: OPTIC j k c) (d :: OPTIC j k c) (a :: OPTIC j k c). (b ~> d) -> Optic_ a b -> Optic_ a d Source Github # (\\) :: forall (a :: OPTIC j k c) (b :: OPTIC j k c) r. ((Ob a, Ob b) => r) -> Optic_ a b -> r Source Github # | |
| type (~>) Source Github # | |
| type Ob (opt :: OPTIC j k c) Source Github # | |
data Optic_ (ab :: OPTIC j k c) (st :: OPTIC j k c) where Source Github #
Constructors
| Optic | |
Instances
| (CategoryOf j, CategoryOf k) => Promonad (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # | |
| (CategoryOf j, CategoryOf k) => Profunctor (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # | |
Defined in Proarrow.Optic Methods dimap :: forall (c0 :: OPTIC j k c) (a :: OPTIC j k c) (b :: OPTIC j k c) (d :: OPTIC j k c). (c0 ~> a) -> (b ~> d) -> Optic_ a b -> Optic_ c0 d Source Github # lmap :: forall (c0 :: OPTIC j k c) (a :: OPTIC j k c) (b :: OPTIC j k c). (c0 ~> a) -> Optic_ a b -> Optic_ c0 b Source Github # rmap :: forall (b :: OPTIC j k c) (d :: OPTIC j k c) (a :: OPTIC j k c). (b ~> d) -> Optic_ a b -> Optic_ a d Source Github # (\\) :: forall (a :: OPTIC j k c) (b :: OPTIC j k c) r. ((Ob a, Ob b) => r) -> Optic_ a b -> r Source Github # | |
type Optic (c :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) = Optic_ ('OPT a b :: OPTIC j k c) ('OPT s t :: OPTIC j k c) Source Github #
(%) :: forall {j} {k} (c1 :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) (c2 :: (j +-> k) -> Constraint) (c :: k) (d :: j). Optic c1 s t a b -> Optic c2 a b c d -> Optic (c1 :&&: c2) s t c d infixl 9 Source Github #
Compose two optics, of any (possibly different) flavors or encodings. The composite's constraint
is the conjunction :&&:, so the composite is usable at the meet of the two flavors'
capabilities: a lens composed with a prism previews, folds, traverses and sets, but
no longer views or reviews. Use convert to name the composite at a single flavor for
storage, e.g. .convert (l % p) :: AffineTraversal s t a b
type PIso (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Profunctor :: (j +-> k) -> Constraint) s t a b Source Github #
iso :: forall {j} {k} (c :: (j +-> k) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k) => (s ~> a) -> (b ~> t) -> Optic c s t a b Source Github #
Create an isomorphism from two arrows, at any optic constraint. This doesn't check that the arrows are inverses!
The same iso builds a Iso, a PIso, a
PTraversal, ... depending on the type it is used at; since c is
only determined by the use site, bind the result with a type signature.
class (forall (f :: k +-> k) (f' :: j +-> j) (g :: k +-> k) (g' :: j +-> j). (w f f', w g g') => w (f :.: g) (g' :.: f'), w (Id :: k -> k -> Type) (Id :: j -> j -> Type)) => Flavor (w :: FLAVOR j k) where Source Github #
A flavor: a class of witness pairs that is closed under composition and contains the identity
pair. This is the monoidal structure of the residuals, with (Id, Id) as unit and
(f :.: g, g' :.: f') (note the reversal on the right) as tensor.
Methods
composeFlavor :: forall (f :: k +-> k) (f' :: j +-> j) (g :: k +-> k) (g' :: j +-> j) r. (w f f', w g g') => (w (f :.: g) (g' :.: f') => r) -> r Source Github #
class Sub (w :: FLAVOR j k) (p :: k +-> k) (q :: j +-> j) where Source Github #
w p q, as a class with a single instance instead of a bare constraint. The subtyping
quantified constraint is spelled forall p q. v p q => Sub w p q because GHC solves the head of
a quantified constraint from a superclass of its premise only when that superclass is strictly
smaller than the head, which a bare w p q head never is. Behind the Sub instance w p q is
an ordinary wanted, solved from the superclasses of v p q. sub hands it back as a given.
Sub has no superclass w p q: with one, a quantified given
forall p q. w p q => Sub IsoFl p q would reach through the flavor
superclasses, and GHC would reject the ordinary Profunctor pProfunctor instances as overlapping.
class (Profunctor p, CategoryOf j, CategoryOf k) => Prostrong (w :: FLAVOR j k) (p :: j +-> k) where Source Github #
The carrier p is w-strong: a Tambara module for the flavor w. proact absorbs a
w-witness pair (f, g) sandwiching p back into p, so that an optic built from that
witness can distribute the carrier. The name is the profunctor ("pro") version of
Proarrow.Category.Monoidal.Strength's Strong: its
proact specializes to act for certain Rep/Corep pairs and to coact for
certain Corep/Rep ones.
Methods
proact :: forall (f :: k +-> k) (g :: j +-> j). (w f g, Profunctor f, Profunctor g) => ((f :.: p) :.: g) :~> p Source Github #
Instances
| (Flavor w, Profunctor p) => Prostrong (w :: FLAVOR j k) (Pastro w p :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Profunctor.Instance.PastroTambara | |
| (Flavor w, Profunctor p) => Prostrong (w :: FLAVOR j k) (Tambara w p :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Profunctor.Instance.PastroTambara | |
| (CategoryOf k, forall (p :: k +-> k) (q :: k +-> k). w p q => Sub (IsoFl :: (k +-> k) -> (k +-> k) -> Constraint) p q) => Prostrong (w :: FLAVOR k k) (Yo a ('OP b) :: k -> k -> Type) Source Github # | Any flavor whose optics are isos has strength for the |
| (CategoryOf j, CategoryOf k, forall (p :: k +-> k) (q :: j +-> j). v p q => Sub w p q, Flavor w) => Prostrong (v :: FLAVOR j k) (ExOptic w a b :: k -> j -> Type) Source Github # | The free |
Defined in Proarrow.Optic | |
| (CategoryOf j, CategoryOf k, Prostrong (Flip w) p) => Prostrong (w :: (j +-> j) -> (k +-> k) -> Constraint) (Re p s t :: j -> k -> Type) Source Github # | |
Defined in Proarrow.Optic | |
| Traversable t => Prostrong (KaleidoFl :: (Type +-> Type) -> (Type +-> Type) -> Constraint) (Costar (Prelude t) :: Type -> Type -> Type) Source Github # | |
| Prostrong (KaleidoFl :: (Type +-> Type) -> (Type +-> Type) -> Constraint) (Costar []) Source Github # | |
| Functor f => Prostrong (LensFl :: (Type +-> Type) -> (Type +-> Type) -> Constraint) (Star (Prelude f) :: Type -> Type -> Type) Source Github # | |
| (Traversable t, Representable t) => Prostrong (CotravFl :: (j +-> j) -> (j +-> j) -> Constraint) (RepCostar t :: j -> j -> Type) Source Github # | The carriers as instances, so that an optic of these flavors composed with another flavor that also runs at the carrier can be eliminated there directly. |
Defined in Proarrow.Optic.Kaleidoscope | |
| (Traversable t, Representable t) => Prostrong (KaleidoFl :: (j +-> j) -> (j +-> j) -> Constraint) (RepCostar t :: j -> j -> Type) Source Github # | |
Defined in Proarrow.Optic.Kaleidoscope | |
| (Cartesian k, Functor f) => Prostrong (PowerGrateFl :: (k +-> k) -> (k +-> k) -> Constraint) (Costar f :: k -> k -> Type) Source Github # | The carrier of the literature's kaleidoscope eliminator ( |
Defined in Proarrow.Optic.PowerGrate Methods proact :: forall (f0 :: k +-> k) (g :: k +-> k). (PowerGrateFl f0 g, Profunctor f0, Profunctor g) => ((f0 :.: Costar f) :.: g) :~> Costar f Source Github # | |
| OplaxMonoidalRep m => Prostrong (AlgLensFl m :: (k +-> k) -> (k +-> k) -> Constraint) (RepCostar m :: k -> k -> Type) Source Github # | The carrier of the literature's algebraic-lens eliminator: |
Defined in Proarrow.Optic.Action | |
| CategoryOf k => Prostrong (Flip (IsoFl :: (k +-> k) -> (k +-> k) -> Constraint) :: (k +-> k) -> (k +-> k) -> Constraint) (Yo a ('OP b) :: k -> k -> Type) Source Github # |
|
| (Prostrong w p, CategoryOf j, CategoryOf k) => Prostrong (OpFlavor w :: (k +-> k) -> (j +-> j) -> Constraint) (UnOp p :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Optic | |
| (Prostrong w p, CategoryOf j, CategoryOf k) => Prostrong (w :: FLAVOR (OPPOSITE k) (OPPOSITE j)) (Op (UnOp p) :: OPPOSITE j -> OPPOSITE k -> Type) Source Github # | |
data ExOptic (w :: FLAVOR j k) (a :: k) (b :: j) (s :: k) (t :: j) where Source Github #
The existential encoding of an optic.
Constructors
| ExOptic :: forall {j} {k} {w :: FLAVOR j k} (p :: k +-> k) (q :: j +-> j) (s :: k) (t :: j) (a :: k) (b :: j). (w p q, Profunctor p, Profunctor q) => p s a -> q b t -> ExOptic w a b s t |
Instances
| (CategoryOf j, CategoryOf k, forall (p :: k +-> k) (q :: j +-> j). v p q => Sub w p q, Flavor w) => Prostrong (v :: FLAVOR j k) (ExOptic w a b :: k -> j -> Type) Source Github # | The free |
Defined in Proarrow.Optic | |
| (Monoidal k, Ob a, Ob b, Flavor w, forall (m :: k). Ob m => w (Corep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m))) => Costrong (Tensor :: k -> (k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | The generic carrier absorbs the residual of a |
| (Monoidal k, Ob a, Ob b, Flavor w, forall (x :: k). Ob x => w (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) x)) (Corep (ActionAt (Tensor :: k -> (k, k) -> Type) x))) => Strong (Tensor :: k -> (k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (Monoidal k, Ob a, Ob b, w (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type), forall (p1 :: k -> k -> Type) (p2 :: k -> k -> Type) (q1 :: k -> k -> Type) (q2 :: k -> k -> Type). (w p1 q1, w p2 q2, Profunctor p1, Profunctor p2, Profunctor q1, Profunctor q2) => w (Beside p1 p2) (CoBeside q1 q2)) => MonoidalProfunctor (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (CategoryOf j, CategoryOf k) => Profunctor (ExOptic w a b :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Optic Methods dimap :: forall (c :: k) (a0 :: k) (b0 :: j) (d :: j). (c ~> a0) -> (b0 ~> d) -> ExOptic w a b a0 b0 -> ExOptic w a b c d Source Github # lmap :: forall (c :: k) (a0 :: k) (b0 :: j). (c ~> a0) -> ExOptic w a b a0 b0 -> ExOptic w a b c b0 Source Github # rmap :: forall (b0 :: j) (d :: j) (a0 :: k). (b0 ~> d) -> ExOptic w a b a0 b0 -> ExOptic w a b a0 d Source Github # (\\) :: forall (a0 :: k) (b0 :: j) r. ((Ob a0, Ob b0) => r) -> ExOptic w a b a0 b0 -> r Source Github # | |
| (HasCoproducts k, Ob a, Ob b, Flavor w, forall (t :: k). Ob t => w (Rep (Coproduct t)) (Corep (Coproduct t))) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (HasProducts k, Ob a, Ob b, Flavor w, forall (s :: k). Ob s => w (Rep (Product s)) (Corep (Product s))) => Strong (ProdAction :: k -> (PROD k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (HasCoproducts k, Ob a, Ob b, w (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type), forall (p1 :: k -> k -> Type) (p2 :: k -> k -> Type) (q1 :: k -> k -> Type) (q2 :: k -> k -> Type). (w p1 q1, w p2 q2, Profunctor p1, Profunctor p2, Profunctor q1, Profunctor q2) => w (BesideSum p1 p2) (CoBesideSum q1 q2)) => MonoidalProfunctor (Coprod (ExOptic w a b) :: COPROD k -> COPROD k -> Type) Source Github # | |
Defined in Proarrow.Optic.MonoidalTraversal | |
legs2prof :: forall {j} {k} (w :: FLAVOR j k) p q (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, w p q, Profunctor p, Profunctor q) => p s a -> q b t -> Optic (Prostrong w) s t a b Source Github #
ex2prof :: forall {j} {k} {w :: FLAVOR j k} (a :: k) (b :: j) (s :: k) (t :: j). (CategoryOf j, CategoryOf k) => ExOptic w a b s t -> Optic (Prostrong w) s t a b Source Github #
prof2ex :: forall {j} {k} (w :: FLAVOR j k) (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> ExOptic w a b s t Source Github #
Run an optic, in any encoding, at its own witness pair (the Pastro-Street move): a
Prostrong-flavored optic discharges c ( through the bridge instance above
(i.e. ExOptic w a b)forall p q. v p q => ), a Sub w p q(%)-composite one conjunct at a time, and a
profunctor-class-flavored one through the carrier's own instances of its class.
withLegs :: forall {j} {k} w (c :: (k -> j -> Type) -> Constraint) (s :: k) (t :: j) (a :: k) (b :: j) r. (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> (forall (p :: k +-> k) (q :: j +-> j). (w p q, Profunctor p, Profunctor q) => p s a -> q b t -> r) -> r Source Github #
prof2ex in continuation-passing form: the generic eliminator.
convert :: forall {j} {k} (c :: (k -> j -> Type) -> Constraint) (w :: FLAVOR j k) (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k, Flavor w, (Ob a, Ob b) => c (ExOptic w a b)) => Optic c s t a b -> Optic (Prostrong w) s t a b Source Github #
Convert an optic to a chosen flavor w, by running it at and wrapping the
resulting witness pair back around the carrier. A ExOptic w a bProstrong-flavored optic converts along the
subtyping lattice (an invalid conversion fails with Could not deduce (w p q)), a
:&&:-composite when both conjuncts do, and a profunctor-class-flavored optic when
has an instance of its class (cf. ExOptic w a bfromPIso,
fromPTraversal, fromPTracer).
Consumers accept any sufficiently strong optic directly, but constructors and % return their
exact type, so convert is how to store an optic at a weaker type, e.g.
convert (.lens f g) :: Traversal' s a
data Re (p :: k -> k1 -> Type) (s :: k1) (t :: k) (a :: k1) (b :: k) where Source Github #
The reversing carrier implementing re: it stores a continuation p b a -> p t s, so
running an optic at builds the optic turned around. Its Re p _ _Prostrong instance
absorbs the witness pair mirrored, via Flip.
Constructors
| Re | |
Instances
| (CategoryOf j, CategoryOf k, Prostrong (Flip w) p) => Prostrong (w :: (j +-> j) -> (k +-> k) -> Constraint) (Re p s t :: j -> k -> Type) Source Github # | |
Defined in Proarrow.Optic | |
| Profunctor p => Profunctor (Re p s t :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Optic Methods dimap :: forall (c :: k) (a :: k) (b :: j) (d :: j). (c ~> a) -> (b ~> d) -> Re p s t a b -> Re p s t c d Source Github # lmap :: forall (c :: k) (a :: k) (b :: j). (c ~> a) -> Re p s t a b -> Re p s t c b Source Github # rmap :: forall (b :: j) (d :: j) (a :: k). (b ~> d) -> Re p s t a b -> Re p s t a d Source Github # (\\) :: forall (a :: k) (b :: j) r. ((Ob a, Ob b) => r) -> Re p s t a b -> r Source Github # | |
class (forall (p :: k +-> j) (a :: k) (b :: j). coc p => c (Re p a b)) => ReversibleOptic (c :: (j +-> k) -> Constraint) (coc :: (k +-> j) -> Constraint) | c -> coc Source Github #
Instances
| ReversibleOptic (Profunctor :: (j +-> k) -> Constraint) (Profunctor :: (k +-> j) -> Constraint) Source Github # | |
Defined in Proarrow.Optic | |
| (ReversibleOptic l l', ReversibleOptic r r') => ReversibleOptic (l :&&: r :: (j +-> k) -> Constraint) (l' :&&: r' :: (k +-> j) -> Constraint) Source Github # | |
Defined in Proarrow.Optic | |
| ReversibleOptic (Prostrong w :: (k +-> j) -> Constraint) (Prostrong (Flip w) :: (j +-> k) -> Constraint) Source Github # | |
Defined in Proarrow.Optic | |
re :: forall {j} {k} (a :: j) (b :: k) (c :: (k +-> j) -> Constraint) (coc :: (j +-> k) -> Constraint) (s :: j) (t :: k). (Ob a, Ob b, ReversibleOptic c coc) => Optic c s t a b -> Optic coc b a t s Source Github #
class w p q => Flip (w :: k -> k1 -> Constraint) (q :: k1) (p :: k) Source Github #
Instances
| w p q => Flip (w :: k1 -> k2 -> Constraint) (q :: k2) (p :: k1) Source Github # | |
Defined in Proarrow.Optic | |
class c (Op q) => OpConstraint (c :: (OPPOSITE j -> OPPOSITE k -> Type) -> Constraint) (q :: j +-> k) Source Github #
Instances
| c (Op q) => OpConstraint (c :: (OPPOSITE j -> OPPOSITE k -> Type) -> Constraint) (q :: j +-> k) Source Github # | |
Defined in Proarrow.Optic | |
class w (Op g) (Op f) => OpFlavor (w :: (OPPOSITE j -> OPPOSITE k -> Type) -> (OPPOSITE j1 -> OPPOSITE k1 -> Type) -> Constraint) (f :: j1 +-> k1) (g :: j +-> k) Source Github #
opOptic :: forall {j} {k} (c :: (OPPOSITE k -> OPPOSITE j -> Type) -> Constraint) (s :: j) (t :: k) (a :: j) (b :: k). (forall (p :: OPPOSITE j +-> OPPOSITE k). c p => c (Op (UnOp p)), CategoryOf j, CategoryOf k) => Optic (OpConstraint c) s t a b -> Optic c ('OP t) ('OP s) ('OP b) ('OP a) Source Github #