semigroupoid-extras-5: Semigroupoids that depend on PolyKinds

Copyright(C) 2011-2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilitypolykinds
Safe HaskellTrustworthy
LanguageHaskell98

Data.Semifunctor

Description

 
Synopsis

Documentation

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

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) #

Instances
Semifunctor f c d => Semifunctor (f :: k1 -> k2) (Dual c :: k1 -> k1 -> Type) (Dual d :: k2 -> k2 -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Dual c a b -> Dual d (f a) (f b) #

(Traversable1 f, Bind m) => Semifunctor (WrappedTraversable1 f :: Type -> Type) (Kleisli m :: Type -> Type -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

(Traversable f, Bind m, Monad m) => Semifunctor (WrappedFunctor f :: Type -> Type) (Kleisli m :: Type -> Type -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Kleisli m a b -> Kleisli m (WrappedFunctor f a) (WrappedFunctor f b) #

Functor f => Semifunctor (WrappedFunctor f :: Type -> Type) ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b #

Bind m => Semifunctor (Bi Either) (Product (Kleisli m) (Kleisli m) :: (Type, Type) -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (Kleisli m) (Kleisli m) a b -> Kleisli m (Bi Either a) (Bi Either b) #

Bind m => Semifunctor (Bi (,)) (Product (Kleisli m) (Kleisli m) :: (Type, Type) -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (Kleisli m) (Kleisli m) a b -> Kleisli m (Bi (,) a) (Bi (,) b) #

Semifunctor (Bi Either) (Product ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type)) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (->) (->) a b -> Bi Either a -> Bi Either b #

Semifunctor (Bi (,)) (Product ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type)) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (->) (->) a b -> Bi (,) a -> Bi (,) b #

data Bi p a where #

Used to map a more traditional bifunctor into a semifunctor

Constructors

Bi :: p a b -> Bi p '(a, b) 
Instances
(Bind m, Monad m) => Disassociative (Kleisli m :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

disassociate :: Kleisli m (Bi (,) (a, Bi (,) (b, c))) (Bi (,) (Bi (,) (a, b), c)) #

(Bind m, Monad m) => Disassociative (Kleisli m :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

disassociate :: Kleisli m (Bi Either (a, Bi Either (b, c))) (Bi Either (Bi Either (a, b), c)) #

(Bind m, Monad m) => Associative (Kleisli m :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

associate :: Kleisli m (Bi (,) (Bi (,) (a, b), c)) (Bi (,) (a, Bi (,) (b, c))) #

(Bind m, Monad m) => Associative (Kleisli m :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

associate :: Kleisli m (Bi Either (Bi Either (a, b), c)) (Bi Either (a, Bi Either (b, c))) #

(Bind m, Monad m) => Symmetric (Kleisli m :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Braided

(Bind m, Monad m) => Symmetric (Kleisli m :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Braided

(Bind m, Monad m) => Braided (Kleisli m :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Braided

Methods

braid :: Kleisli m (Bi (,) (a, b)) (Bi (,) (b, a)) #

(Bind m, Monad m) => Braided (Kleisli m :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Braided

Methods

braid :: Kleisli m (Bi Either (a, b)) (Bi Either (b, a)) #

Disassociative ((->) :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

disassociate :: Bi Either (a, Bi Either (b, c)) -> Bi Either (Bi Either (a, b), c) #

Disassociative ((->) :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

disassociate :: Bi (,) (a, Bi (,) (b, c)) -> Bi (,) (Bi (,) (a, b), c) #

Associative ((->) :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

associate :: Bi Either (Bi Either (a, b), c) -> Bi Either (a, Bi Either (b, c)) #

Associative ((->) :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Associative

Methods

associate :: Bi (,) (Bi (,) (a, b), c) -> Bi (,) (a, Bi (,) (b, c)) #

Symmetric ((->) :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Braided

Symmetric ((->) :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Braided

Braided ((->) :: Type -> Type -> Type) (Bi Either) # 
Instance details

Defined in Data.Semifunctor.Braided

Methods

braid :: Bi Either (a, b) -> Bi Either (b, a) #

Braided ((->) :: Type -> Type -> Type) (Bi (,)) # 
Instance details

Defined in Data.Semifunctor.Braided

Methods

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

Bind m => Semifunctor (Bi Either) (Product (Kleisli m) (Kleisli m) :: (Type, Type) -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (Kleisli m) (Kleisli m) a b -> Kleisli m (Bi Either a) (Bi Either b) #

Bind m => Semifunctor (Bi (,)) (Product (Kleisli m) (Kleisli m) :: (Type, Type) -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (Kleisli m) (Kleisli m) a b -> Kleisli m (Bi (,) a) (Bi (,) b) #

Semifunctor (Bi Either) (Product ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type)) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (->) (->) a b -> Bi Either a -> Bi Either b #

Semifunctor (Bi (,)) (Product ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type)) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Product (->) (->) a b -> Bi (,) a -> Bi (,) b #

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

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

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

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

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

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

data WrappedFunctor f a #

Constructors

WrapFunctor 

Fields

Instances
(Traversable f, Bind m, Monad m) => Semifunctor (WrappedFunctor f :: Type -> Type) (Kleisli m :: Type -> Type -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: Kleisli m a b -> Kleisli m (WrappedFunctor f a) (WrappedFunctor f b) #

Functor f => Semifunctor (WrappedFunctor f :: Type -> Type) ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor

Methods

semimap :: (a -> b) -> WrappedFunctor f a -> WrappedFunctor f b #

data WrappedTraversable1 f a #

Constructors

WrapTraversable1 

Fields

Instances
(Traversable1 f, Bind m) => Semifunctor (WrappedTraversable1 f :: Type -> Type) (Kleisli m :: Type -> Type -> Type) (Kleisli m :: Type -> Type -> Type) # 
Instance details

Defined in Data.Semifunctor