semigroupoids-4.3: Semigroupoids: Category sans id

Data.Semifunctor

Synopsis

# Documentation

class (Semigroupoid c, Semigroupoid d) => Semifunctor f c d | f c -> d, f d -> c where Source

Semifunctors map objects to objects, and arrows to arrows preserving connectivity as normal functors, but do not purport to preserve identity arrows. We apply them to semigroupoids, because those don't even claim to offer identity arrows!

Methods

semimap :: c a b -> d (f a) (f b) Source

Instances

 Semifunctor f c d => Semifunctor f (Dual c) (Dual d) Functor f => Semifunctor (WrappedFunctor f) (->) (->) (Traversable1 f, Bind m) => Semifunctor (WrappedTraversable1 f) (Kleisli m) (Kleisli m) (Distributive f, Extend w) => Semifunctor (WrappedFunctor f) (Cokleisli w) (Cokleisli w) (Traversable f, Bind m, Monad m) => Semifunctor (WrappedFunctor f) (Kleisli m) (Kleisli m) Semifunctor (Bi Either) (Product (->) (->)) (->) Semifunctor (Bi (,)) (Product (->) (->)) (->) Bind m => Semifunctor (Bi Either) (Product (Kleisli m) (Kleisli m)) (Kleisli m) Bind m => Semifunctor (Bi (,)) (Product (Kleisli m) (Kleisli m)) (Kleisli m) Extend w => Semifunctor (Bi (,)) (Product (Cokleisli w) (Cokleisli w)) (Cokleisli w)

data Bi p a where Source

Used to map a more traditional bifunctor into a semifunctor

Constructors

 Bi :: p a b -> Bi p (a, b)

Instances

(#) :: a -> b -> Bi (,) (a, b) Source

semibimap :: Semifunctor p (Product l r) cod => l a b -> r c d -> cod (p (a, c)) (p (b, d)) Source

semifirst :: (Semifunctor p (Product l r) cod, Ob r c) => l a b -> cod (p (a, c)) (p (b, c)) Source

semisecond :: (Semifunctor p (Product l r) cod, Ob l a) => r b c -> cod (p (a, b)) (p (a, c)) Source

first :: (Semifunctor p (Product l r) cod, Category r) => l a b -> cod (p (a, c)) (p (b, c)) Source

second :: (Semifunctor p (Product l r) cod, Category l) => r b c -> cod (p (a, b)) (p (a, c)) Source

data WrappedFunctor f a Source

Constructors

 WrapFunctor FieldsunwrapFunctor :: f a

Instances

 Functor f => Semifunctor (WrappedFunctor f) (->) (->) (Distributive f, Extend w) => Semifunctor (WrappedFunctor f) (Cokleisli w) (Cokleisli w) (Traversable f, Bind m, Monad m) => Semifunctor (WrappedFunctor f) (Kleisli m) (Kleisli m)

data WrappedTraversable1 f a Source

Constructors

 WrapTraversable1 FieldsunwrapTraversable1 :: f a

Instances

 (Traversable1 f, Bind m) => Semifunctor (WrappedTraversable1 f) (Kleisli m) (Kleisli m)