proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Optic

Synopsis

Documentation

data OPTIC j k (c :: (j +-> k) -> Constraint) Source Github #

Constructors

OPT k j 

Instances

Instances details
(CategoryOf j, CategoryOf k) => CategoryOf (OPTIC j k c) Source Github # 
Instance details

Defined in Proarrow.Optic

Associated Types

type (~>) 
Instance details

Defined in Proarrow.Optic

type (~>) = Optic_ :: OPTIC j k c -> OPTIC j k c -> Type
(CategoryOf j, CategoryOf k) => Promonad (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic

Methods

id :: forall (a :: OPTIC j k c). Ob a => Optic_ a a Source Github #

(.) :: forall (b :: OPTIC j k c) (c0 :: OPTIC j k c) (a :: OPTIC j k c). Optic_ b c0 -> Optic_ a b -> Optic_ a c0 Source Github #

(CategoryOf j, CategoryOf k) => Profunctor (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # 
Instance details

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 #

(\\) :: 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 # 
Instance details

Defined in Proarrow.Optic

type (~>) = Optic_ :: OPTIC j k c -> OPTIC j k c -> Type
type Ob (opt :: OPTIC j k c) Source Github # 
Instance details

Defined in Proarrow.Optic

type Ob (opt :: OPTIC j k c) = (opt ~ ('OPT (OptL opt) (OptR opt) :: OPTIC j k c), Ob (OptL opt), Ob (OptR opt))

type family OptL (p :: OPTIC j k c) :: k where ... Source Github #

Equations

OptL ('OPT j2 k2 :: OPTIC j1 k1 c) = j2 

type family OptR (p :: OPTIC j k c) :: j where ... Source Github #

Equations

OptR ('OPT j2 k2 :: OPTIC j1 k1 c) = k2 

data Optic_ (ab :: OPTIC j k c) (st :: OPTIC j k c) where Source Github #

Constructors

Optic 

Fields

Instances

Instances details
(CategoryOf j, CategoryOf k) => Promonad (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic

Methods

id :: forall (a :: OPTIC j k c). Ob a => Optic_ a a Source Github #

(.) :: forall (b :: OPTIC j k c) (c0 :: OPTIC j k c) (a :: OPTIC j k c). Optic_ b c0 -> Optic_ a b -> Optic_ a c0 Source Github #

(CategoryOf j, CategoryOf k) => Profunctor (Optic_ :: OPTIC j k c -> OPTIC j k c -> Type) Source Github # 
Instance details

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 #

(\\) :: 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 #

type Optic' (c :: (j +-> j) -> Constraint) (s :: j) (a :: j) = Optic c s s a a Source Github #

class (c1 p, c2 p) => ((c1 :: k -> Constraint) :&&: (c2 :: k -> Constraint)) (p :: k) Source Github #

Instances

Instances details
(c1 p, c2 p) => ((c1 :: k -> Constraint) :&&: (c2 :: k -> Constraint)) (p :: k) Source Github # 
Instance details

Defined in Proarrow.Optic

(%) :: 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 Source Github #

Compose optics if different kinds

type (:=>) (c :: (j +-> k) -> Constraint) (d :: (j +-> k) -> Constraint) = forall (p :: j +-> k). c p => d p Source Github #

type Iso (s :: k) (t :: j) (a :: k) (b :: j) = Optic (Profunctor :: (j +-> k) -> Constraint) s t a b Source Github #

type Iso' (s :: j) (a :: j) = Iso s s a a Source Github #

iso :: forall {j} {k} (s :: k) (t :: j) (a :: k) (b :: j). (CategoryOf j, CategoryOf k) => (s ~> a) -> (b ~> t) -> Iso s t a b Source Github #

data Re (p :: k -> k1 -> Type) (s :: k1) (t :: k) (a :: k1) (b :: k) where Source Github #

Constructors

Re 

Fields

  • :: forall {k1} {k} (a :: k1) (b :: k) (p :: k -> k1 -> Type) (t :: k) (s :: k1). (Ob a, Ob b)
     
  • => { unRe :: p b a -> p t s
     
  •    } -> Re p s t a b
     

Instances

Instances details
Strong m p => Costrong m (Re p s t :: d -> c -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

coact :: forall (a :: m) (x :: d) (y :: c). (Ob a, Ob x, Ob y) => Re p s t (Act a x) (Act a y) -> Re p s t x y Source Github #

Costrong m p => Strong m (Re p s t :: d -> c -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a :: m) (b :: m) (x :: d) (y :: c). (a ~> b) -> Re p s t x y -> Re p s t (Act a x) (Act b y) Source Github #

Profunctor p => Profunctor (Re p s t :: k -> j -> Type) Source Github # 
Instance details

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 #

(\\) :: 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)) => InvertableOptic (c :: (j +-> k) -> Constraint) (coc :: (k +-> j) -> Constraint) | c -> coc Source Github #

Instances

Instances details
InvertableOptic (Profunctor :: (j +-> k) -> Constraint) (Profunctor :: (k +-> j) -> Constraint) Source Github # 
Instance details

Defined in Proarrow.Optic

InvertableOptic (Costrong m :: (j +-> k) -> Constraint) (Strong m :: (k +-> j) -> Constraint) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

InvertableOptic (Strong m :: (j +-> k) -> Constraint) (Costrong m :: (k +-> j) -> Constraint) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

(InvertableOptic l l', InvertableOptic r r') => InvertableOptic (l :&&: r :: (j +-> k) -> Constraint) (l' :&&: r' :: (k +-> j) -> Constraint) Source Github # 
Instance details

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, InvertableOptic c coc) => Optic c s t a b -> Optic coc b a t s Source Github #