| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Optic.Iso
Contents
Description
The iso: the bottom of the subtyping lattice, usable as every other flavor. IsoFl is
simply the conjunction of the five maximal flavors (LensFl,
PrismFl, PowerGrateFl,
MonLensFl and TracerFl). Build with iso, eliminate to the two legs with
withIso via the Yo carrier -- which also eliminates re-versed isos, a
conversion the subtyping lattice itself cannot express; fromPIso/toPIso mediate with the
profunctor-class-flavored PIso.
Synopsis
- class (LensFl p q, PrismFl p q, PowerGrateFl p q, MonLensFl p q, TracerFl p q) => IsoFl (p :: k +-> k) (q :: k +-> k)
- type Iso (s :: k) (t :: k) (a :: k) (b :: k) = Optic (Prostrong (IsoFl :: (k +-> k) -> (k +-> k) -> Constraint)) s t a b
- type Iso' (s :: k) (a :: k) = Iso s s a a
- withIso :: forall {k} (c :: (k -> k -> Type) -> Constraint) (s :: k) (t :: k) (a :: k) (b :: k) r. (CategoryOf k, (Ob a, Ob b) => c (Yo a ('OP b))) => Optic c s t a b -> ((s ~> a) -> (b ~> t) -> r) -> r
- fromPIso :: forall {k} (s :: k) (t :: k) (a :: k) (b :: k). CategoryOf k => PIso s t a b -> Iso s t a b
- toPIso :: forall {k} (s :: k) (t :: k) (a :: k) (b :: k). CategoryOf k => Iso s t a b -> PIso s t a b
Documentation
class (LensFl p q, PrismFl p q, PowerGrateFl p q, MonLensFl p q, TracerFl p q) => IsoFl (p :: k +-> k) (q :: k +-> k) Source Github #
type Iso (s :: k) (t :: k) (a :: k) (b :: k) = Optic (Prostrong (IsoFl :: (k +-> k) -> (k +-> k) -> Constraint)) s t a b Source Github #
withIso :: forall {k} (c :: (k -> k -> Type) -> Constraint) (s :: k) (t :: k) (a :: k) (b :: k) r. (CategoryOf k, (Ob a, Ob b) => c (Yo a ('OP b))) => Optic c s t a b -> ((s ~> a) -> (b ~> t) -> r) -> r Source Github #
fromPIso :: forall {k} (s :: k) (t :: k) (a :: k) (b :: k). CategoryOf k => PIso s t a b -> Iso s t a b Source Github #
The two iso encodings are equivalent: this direction instantiates the
profunctor-class-flavored iso at the free IsoFl-strong profunctor ExOptic ,
which needs nothing beyond its IsoFl a bProfunctor instance.
toPIso :: forall {k} (s :: k) (t :: k) (a :: k) (b :: k). CategoryOf k => Iso s t a b -> PIso s t a b Source Github #
The other direction of the equivalence, by eliminating to legs and rebuilding.