proarrow-0: Category theory with a central role for profunctors
Safe HaskellNone
LanguageHaskell2010

Proarrow.Category.Monoidal.Optic

Documentation

data Optic (w :: PRO m m') (a :: c) (b :: d) (s :: c) (t :: d) where Source Comments #

Constructors

Optic :: forall {c} {d} {m} {m'} (x :: m) (x' :: m') (a :: c) (b :: d) (s :: c) (t :: d) (w :: PRO m m'). (Ob a, Ob b) => (s ~> Act x a) -> w x x' -> (Act x' b ~> t) -> Optic w a b s t 

Instances

Instances details
IsOptic w c d => Strong (w :: PRO m m') (Optic w a b :: c -> d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: m) (b0 :: m') (x :: c) (y :: d). w a0 b0 -> Optic w a b x y -> Optic w a b (Act a0 x) (Act b0 y) Source Comments #

(CategoryOf c, CategoryOf d) => Profunctor (Optic w a b :: c -> d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall (c0 :: c) (a0 :: c) (b0 :: d) (d0 :: d). (c0 ~> a0) -> (b0 ~> d0) -> Optic w a b a0 b0 -> Optic w a b c0 d0 Source Comments #

(\\) :: forall (a0 :: c) (b0 :: d) r. ((Ob a0, Ob b0) => r) -> Optic w a b a0 b0 -> r Source Comments #

parallel :: forall {k1} {j1} {k2} {k3} {k4} {j2} {k5} {k6} (w :: PRO k1 j1) (a :: k2) (b :: k3) (s :: k2) (t :: k3) (w' :: PRO k4 j2) (c :: k5) (d :: k6) (u :: k5) (v :: k6). Optic w a b s t -> Optic w' c d u v -> Optic (w :**: w') '(a, c) '(b, d) '(s, u) '(t, v) Source Comments #

data OPTIC (w :: PRO m m') c d Source Comments #

Constructors

OPT c d 

Instances

Instances details
IsOptic w c d => CategoryOf (OPTIC w c d) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Associated Types

type (~>) 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

type (~>) = OpticCat :: OPTIC w c d -> OPTIC w c d -> Type
IsOptic w c d => Promonad (OpticCat :: OPTIC w c d -> OPTIC w c d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

id :: forall (a :: OPTIC w c d). Ob a => OpticCat a a Source Comments #

(.) :: forall (b :: OPTIC w c d) (c0 :: OPTIC w c d) (a :: OPTIC w c d). OpticCat b c0 -> OpticCat a b -> OpticCat a c0 Source Comments #

IsOptic w c d => Profunctor (OpticCat :: OPTIC w c d -> OPTIC w c d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall (c0 :: OPTIC w c d) (a :: OPTIC w c d) (b :: OPTIC w c d) (d0 :: OPTIC w c d). (c0 ~> a) -> (b ~> d0) -> OpticCat a b -> OpticCat c0 d0 Source Comments #

(\\) :: forall (a :: OPTIC w c d) (b :: OPTIC w c d) r. ((Ob a, Ob b) => r) -> OpticCat a b -> r Source Comments #

type (~>) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

type (~>) = OpticCat :: OPTIC w c d -> OPTIC w c d -> Type
type Ob (a :: OPTIC w c d) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

type Ob (a :: OPTIC w c d) = (a ~ ('OPT (LCat a) (RCat a) :: OPTIC w c d), Ob (LCat a), Ob (RCat a))

type family LCat (p :: OPTIC w c d) :: c where ... Source Comments #

Equations

LCat ('OPT c2 d2 :: OPTIC w c1 d1) = c2 

type family RCat (p :: OPTIC w c d) :: d where ... Source Comments #

Equations

RCat ('OPT c2 d2 :: OPTIC w c1 d1) = d2 

data OpticCat (ab :: OPTIC w c d) (st :: OPTIC w c d) where Source Comments #

Constructors

OpticCat :: forall {m} {m'} (w :: PRO m m') c (a :: c) d (b :: d) (s :: c) (t :: d). Optic w a b s t -> OpticCat ('OPT a b :: OPTIC w c d) ('OPT s t :: OPTIC w c d) 

Instances

Instances details
IsOptic w c d => Promonad (OpticCat :: OPTIC w c d -> OPTIC w c d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

id :: forall (a :: OPTIC w c d). Ob a => OpticCat a a Source Comments #

(.) :: forall (b :: OPTIC w c d) (c0 :: OPTIC w c d) (a :: OPTIC w c d). OpticCat b c0 -> OpticCat a b -> OpticCat a c0 Source Comments #

IsOptic w c d => Profunctor (OpticCat :: OPTIC w c d -> OPTIC w c d -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall (c0 :: OPTIC w c d) (a :: OPTIC w c d) (b :: OPTIC w c d) (d0 :: OPTIC w c d). (c0 ~> a) -> (b ~> d0) -> OpticCat a b -> OpticCat c0 d0 Source Comments #

(\\) :: forall (a :: OPTIC w c d) (b :: OPTIC w c d) r. ((Ob a, Ob b) => r) -> OpticCat a b -> r Source Comments #

type ProfOptic (w :: m +-> m') (a :: k) (b :: k1) (s :: k) (t :: k1) = forall (p :: k1 +-> k). Strong w p => p a b -> p s t Source Comments #

type MixedOptic m (a :: k) (b :: k1) (s :: k) (t :: k1) = ProfOptic ((~>) :: CAT m) a b s t Source Comments #

ex2prof :: forall {m'} {m} {k1} {k2} (w :: PRO m' m) (a :: k1) (b :: k2) (s :: k1) (t :: k2). Optic w a b s t -> ProfOptic w a b s t Source Comments #

prof2ex :: forall {c} {d} m m' (w :: m' +-> m) (a :: c) (b :: d) (s :: c) (t :: d). (MonoidalProfunctor w, MonoidalAction m c, MonoidalAction m' d, Ob a, Ob b) => ProfOptic w a b s t -> Optic w a b s t Source Comments #

type Lens (s :: k) (t :: k1) (a :: k) (b :: k1) = MixedOptic Type a b s t Source Comments #

mkLens :: (s -> a) -> (s -> b -> t) -> Lens s t a b Source Comments #

type Prism (s :: k) (t :: k1) (a :: k) (b :: k1) = MixedOptic (COPROD Type) ('COPR a) ('COPR b) ('COPR s) ('COPR t) Source Comments #

mkPrism :: (s -> Either t a) -> (b -> t) -> Prism s t a b Source Comments #

type Traversal (s :: k) (t :: k1) (a :: k) (b :: k1) = MixedOptic (Type -> Type) a b s t Source Comments #

traversing :: forall (f :: Type -> Type) a b. Traversable f => Traversal (f a) (f b) a b Source Comments #

class Monad m => Algebra (m :: Type -> Type) a where Source Comments #

Methods

algebra :: m a -> a Source Comments #

Instances

Instances details
Monad m => Algebra m () Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

algebra :: m () -> () Source Comments #

Monad m => Algebra m (m a) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

algebra :: m (m a) -> m a Source Comments #

(Monad m, Algebra m a, Algebra m b) => Algebra m (a, b) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

algebra :: m (a, b) -> (a, b) Source Comments #

type AlgebraicLens (m :: Type -> Type) (s :: k) (t :: k1) (a :: k) (b :: k1) = MixedOptic (SUBCAT (Algebra m)) a b s t Source Comments #

mkAlgebraicLens :: forall m s t a b. Monad m => (s -> a) -> (m s -> b -> t) -> AlgebraicLens m s t a b Source Comments #

newtype Viewing a b s t Source Comments #

Constructors

Viewing 

Fields

Instances

Instances details
Strong (->) (Viewing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: (a0 -> b0) -> Viewing a b x y -> Viewing a b (Act a0 x) (Act b0 y) Source Comments #

Profunctor (Viewing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: (c ~> a0) -> (b0 ~> d) -> Viewing a b a0 b0 -> Viewing a b c d Source Comments #

(\\) :: ((Ob a0, Ob b0) => r) -> Viewing a b a0 b0 -> r Source Comments #

(^.) :: s -> (Viewing a b a b -> Viewing a b s t) -> a infixl 8 Source Comments #

data Previewing (a :: COPROD Type) (b :: COPROD Type) (s :: COPROD Type) (t :: COPROD Type) where Source Comments #

Constructors

Previewing 

Fields

Instances

Instances details
Strong (->) (Previewing a b :: COPROD Type -> COPROD Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall a0 b0 (x :: COPROD Type) (y :: COPROD Type). (a0 -> b0) -> Previewing a b x y -> Previewing a b (Act a0 x) (Act b0 y) Source Comments #

Strong (Coprod (->)) (Previewing a b :: COPROD Type -> COPROD Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: COPROD Type) (b0 :: COPROD Type) (x :: COPROD Type) (y :: COPROD Type). Coprod (->) a0 b0 -> Previewing a b x y -> Previewing a b (Act a0 x) (Act b0 y) Source Comments #

Profunctor (Previewing a b :: COPROD Type -> COPROD Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall (c :: COPROD Type) (a0 :: COPROD Type) (b0 :: COPROD Type) (d :: COPROD Type). (c ~> a0) -> (b0 ~> d) -> Previewing a b a0 b0 -> Previewing a b c d Source Comments #

(\\) :: forall (a0 :: COPROD Type) (b0 :: COPROD Type) r. ((Ob a0, Ob b0) => r) -> Previewing a b a0 b0 -> r Source Comments #

(?.) :: s -> (Previewing ('COPR a) ('COPR b) ('COPR a) ('COPR b) -> Previewing ('COPR a) ('COPR b) ('COPR s) ('COPR t)) -> Maybe a infixl 8 Source Comments #

newtype Setting a b s t Source Comments #

Constructors

Setting 

Fields

  • unSet :: (a -> b) -> s -> t
     

Instances

Instances details
Strong (->) (Setting a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: (a0 -> b0) -> Setting a b x y -> Setting a b (Act a0 x) (Act b0 y) Source Comments #

Profunctor (Setting a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: (c ~> a0) -> (b0 ~> d) -> Setting a b a0 b0 -> Setting a b c d Source Comments #

(\\) :: ((Ob a0, Ob b0) => r) -> Setting a b a0 b0 -> r Source Comments #

Strong (Coprod (->)) (Setting a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: COPROD Type) (b0 :: COPROD Type) x y. Coprod (->) a0 b0 -> Setting a b x y -> Setting a b (Act a0 x) (Act b0 y) Source Comments #

(.~) :: (Setting a b a b -> Setting a b s t) -> b -> s -> t infixl 8 Source Comments #

type KlCat (m :: Type -> Type) = KLEISLI (Star (Prelude m)) Source Comments #

data Updating (a :: k) (b :: KlCat m) s (t :: KlCat m) where Source Comments #

Constructors

Update 

Fields

Instances

Instances details
Monad m => Strong (->) (Updating a b :: Type -> KlCat m -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall a0 b0 x (y :: KlCat m). (a0 -> b0) -> Updating a b x y -> Updating a b (Act a0 x) (Act b0 y) Source Comments #

Monad m => Profunctor (Updating a b :: Type -> KlCat m -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: forall c a0 (b0 :: KlCat m) (d :: KlCat m). (c ~> a0) -> (b0 ~> d) -> Updating a b a0 b0 -> Updating a b c d Source Comments #

(\\) :: forall a0 (b0 :: KlCat m) r. ((Ob a0, Ob b0) => r) -> Updating a b a0 b0 -> r Source Comments #

mupdate :: Monad m => (Updating a ('KL b :: KLEISLI (Star (Prelude m))) a ('KL b :: KLEISLI (Star (Prelude m))) -> Updating a ('KL b :: KLEISLI (Star (Prelude m))) s ('KL t :: KLEISLI (Star (Prelude m)))) -> b -> s -> m t Source Comments #

newtype Replacing a b s t Source Comments #

Constructors

Replace 

Fields

Instances

Instances details
Strong (->) (Replacing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: (a0 -> b0) -> Replacing a b x y -> Replacing a b (Act a0 x) (Act b0 y) Source Comments #

Profunctor (Replacing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: (c ~> a0) -> (b0 ~> d) -> Replacing a b a0 b0 -> Replacing a b c d Source Comments #

(\\) :: ((Ob a0, Ob b0) => r) -> Replacing a b a0 b0 -> r Source Comments #

Strong (Coprod (->)) (Replacing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: COPROD Type) (b0 :: COPROD Type) x y. Coprod (->) a0 b0 -> Replacing a b x y -> Replacing a b (Act a0 x) (Act b0 y) Source Comments #

Strong (Nat :: (Type -> Type) -> (Type -> Type) -> Type) (Replacing a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: Type -> Type) (b0 :: Type -> Type) x y. Nat a0 b0 -> Replacing a b x y -> Replacing a b (Act a0 x) (Act b0 y) Source Comments #

(%~) :: (Replacing a b a b -> Replacing a b s t) -> (a -> b) -> s -> t infixl 8 Source Comments #

newtype Classifying (m :: Type -> Type) (a :: k) b s t Source Comments #

Constructors

Classifying 

Fields

Instances

Instances details
Monad m => Profunctor (Classifying m a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

dimap :: (c ~> a0) -> (b0 ~> d) -> Classifying m a b a0 b0 -> Classifying m a b c d Source Comments #

(\\) :: ((Ob a0, Ob b0) => r) -> Classifying m a b a0 b0 -> r Source Comments #

Monad m => Strong (Sub (->) :: SUBCAT (Algebra m) -> SUBCAT (Algebra m) -> Type) (Classifying m a b :: Type -> Type -> Type) Source Comments # 
Instance details

Defined in Proarrow.Category.Monoidal.Optic

Methods

act :: forall (a0 :: SUBCAT (Algebra m)) (b0 :: SUBCAT (Algebra m)) x y. Sub (->) a0 b0 -> Classifying m a b x y -> Classifying m a b (Act a0 x) (Act b0 y) Source Comments #

(.?) :: Monad m => (Classifying m a b a b -> Classifying m a b s t) -> b -> m s -> t infixl 8 Source Comments #