semigroupoid-extras-0.2.7.2: Semigroupoids requiring Haskell extensions

Safe HaskellSafe-Infered

Data.Semifunctor

Synopsis

Documentation

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

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

data Bi p a whereSource

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 

Fields

unwrapFunctor :: f a