categories-0.58.0.4: categories from category-extras

Portabilitynon-portable (functional-dependencies)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Categorical.Bifunctor

Description

A more categorical definition of Bifunctor

Documentation

class (Category r, Category t) => PFunctor p r t | p r -> t, p t -> r whereSource

Methods

first :: r a b -> t (p a c) (p b c)Source

Instances

PFunctor Either (->) (->) 
PFunctor (,) (->) (->) 

firstDefault :: Bifunctor p r s t => r a b -> t (p a c) (p b c)Source

class (Category s, Category t) => QFunctor q s t | q s -> t, q t -> s whereSource

Methods

second :: s a b -> t (q c a) (q c b)Source

Instances

QFunctor (->) (->) (->) 
QFunctor Either (->) (->) 
QFunctor (,) (->) (->) 

secondDefault :: Bifunctor p r s t => s a b -> t (p c a) (p c b)Source

class (PFunctor p r t, QFunctor p s t) => Bifunctor p r s t | p r -> s t, p s -> r t, p t -> r s whereSource

Methods

bimap :: r a b -> s c d -> t (p a c) (p b d)Source

Instances

Bifunctor Either (->) (->) (->) 
Bifunctor (,) (->) (->) (->) 

dimap :: Bifunctor f (Dual s) t u => s b a -> t c d -> u (f a c) (f b d)Source

difirst :: PFunctor f (Dual s) t => s b a -> t (f a c) (f b c)Source