-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Categories
--   
--   Categories
@package categories
@version 1.0.7

-- | A more categorical definition of Functor
module Control.Categorical.Functor
class (Category r, Category t) => Functor (f :: Type -> Type) (r :: Type -> Type -> Type) (t :: Type -> Type -> Type) | f r -> t, f t -> r
fmap :: Functor f r t => r a b -> t (f a) (f b)
class Functor f a a => Endofunctor (f :: Type -> Type) (a :: Type -> Type -> Type)
newtype LiftedFunctor (f :: Type -> Type) a
LiftedFunctor :: f a -> LiftedFunctor (f :: Type -> Type) a
newtype LoweredFunctor (f :: Type -> Type) a
LoweredFunctor :: f a -> LoweredFunctor (f :: Type -> Type) a
instance (GHC.Internal.Data.Typeable.Internal.Typeable f, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data a) => GHC.Internal.Data.Data.Data (Control.Categorical.Functor.LiftedFunctor f a)
instance (GHC.Internal.Data.Typeable.Internal.Typeable f, GHC.Internal.Data.Data.Data (f a), GHC.Internal.Data.Data.Data a) => GHC.Internal.Data.Data.Data (Control.Categorical.Functor.LoweredFunctor f a)
instance Control.Categorical.Functor.Functor f a a => Control.Categorical.Functor.Endofunctor f a
instance Control.Categorical.Functor.Functor f (->) (->) => GHC.Internal.Base.Functor (Control.Categorical.Functor.LoweredFunctor f)
instance Control.Categorical.Functor.Functor (GHC.Internal.Data.Either.Either a) (->) (->)
instance Control.Categorical.Functor.Functor GHC.Types.IO (->) (->)
instance GHC.Internal.Base.Functor f => Control.Categorical.Functor.Functor (Control.Categorical.Functor.LiftedFunctor f) (->) (->)
instance Control.Categorical.Functor.Functor [] (->) (->)
instance Control.Categorical.Functor.Functor GHC.Internal.Maybe.Maybe (->) (->)
instance Control.Categorical.Functor.Functor ((,) a) (->) (->)
instance GHC.Internal.Read.Read (f a) => GHC.Internal.Read.Read (Control.Categorical.Functor.LiftedFunctor f a)
instance GHC.Internal.Read.Read (f a) => GHC.Internal.Read.Read (Control.Categorical.Functor.LoweredFunctor f a)
instance GHC.Internal.Show.Show (f a) => GHC.Internal.Show.Show (Control.Categorical.Functor.LiftedFunctor f a)
instance GHC.Internal.Show.Show (f a) => GHC.Internal.Show.Show (Control.Categorical.Functor.LoweredFunctor f a)

-- | This module declares the HasTerminalObject and
--   HasInitialObject classes.
--   
--   These are both special cases of the idea of a (co)limit.
module Control.Categorical.Object

-- | The Category (~>) has a terminal object Terminal
--   (~>) such that for all objects a in (~>),
--   there exists a unique morphism from a to Terminal
--   (~>).
class Category k => HasTerminalObject (k :: Type -> Type -> Type) where {
    type Terminal (k :: Type -> Type -> Type);
}
terminate :: HasTerminalObject k => k a (Terminal k)

-- | The Category (~>) has an initial (coterminal) object
--   Initial (~>) such that for all objects a in
--   (~>), there exists a unique morphism from Initial
--   (~>)  to a.
class Category k => HasInitialObject (k :: Type -> Type -> Type) where {
    type Initial (k :: Type -> Type -> Type);
}
initiate :: HasInitialObject k => k (Initial k) a

module Control.Category.Discrete

-- | Category of discrete objects. The only arrows are identity arrows.
data Discrete a b
[Refl] :: forall a. Discrete a a

-- | Discrete a b acts as a proof that a = b, lift that proof into
--   something of kind * -> *
liftDiscrete :: Discrete a b -> Discrete (f a) (f b)

-- | Lower the proof that a ~ b to an arbitrary category.
cast :: Category k => Discrete a b -> k a b
inverse :: Discrete a b -> Discrete b a
instance GHC.Internal.Control.Category.Category Control.Category.Discrete.Discrete

module Control.Category.Dual
data Dual (k :: Type -> Type -> Type) a b
Dual :: k b a -> Dual (k :: Type -> Type -> Type) a b
[runDual] :: Dual (k :: Type -> Type -> Type) a b -> k b a
instance GHC.Internal.Control.Category.Category k => GHC.Internal.Control.Category.Category (Control.Category.Dual.Dual k)
instance (GHC.Internal.Data.Typeable.Internal.Typeable k, GHC.Internal.Data.Data.Data a, GHC.Internal.Data.Data.Data b, GHC.Internal.Data.Data.Data (k b a)) => GHC.Internal.Data.Data.Data (Control.Category.Dual.Dual k a b)

-- | A more categorical definition of Bifunctor
module Control.Categorical.Bifunctor
class (Category r, Category t) => PFunctor (p :: Type -> Type -> Type) (r :: Type -> Type -> Type) (t :: Type -> Type -> Type) | p r -> t, p t -> r
first :: PFunctor p r t => r a b -> t (p a c) (p b c)
class (Category s, Category t) => QFunctor (q :: Type -> Type -> Type) (s :: Type -> Type -> Type) (t :: Type -> Type -> Type) | q s -> t, q t -> s
second :: QFunctor q s t => s a b -> t (q c a) (q c b)

-- | Minimal definition: bimap
class (PFunctor p r t, QFunctor p s t) => Bifunctor (p :: Type -> Type -> Type) (r :: Type -> Type -> Type) (s :: Type -> Type -> Type) (t :: Type -> Type -> Type) | p r -> s t, p s -> r t, p t -> r s
bimap :: Bifunctor p r s t => r a b -> s c d -> t (p a c) (p b d)
dimap :: Bifunctor f (Dual s) t u => s b a -> t c d -> u (f a c) (f b d)
difirst :: PFunctor f (Dual s) t => s b a -> t (f a c) (f b c)
instance Control.Categorical.Bifunctor.Bifunctor GHC.Internal.Data.Either.Either (->) (->) (->)
instance Control.Categorical.Bifunctor.Bifunctor (,) (->) (->) (->)
instance Control.Categorical.Bifunctor.PFunctor GHC.Internal.Data.Either.Either (->) (->)
instance Control.Categorical.Bifunctor.PFunctor (,) (->) (->)
instance Control.Categorical.Bifunctor.QFunctor GHC.Internal.Data.Either.Either (->) (->)
instance Control.Categorical.Bifunctor.QFunctor (->) (->) (->)
instance Control.Categorical.Bifunctor.QFunctor (,) (->) (->)

-- | where the pentagonal condition does not hold, but for which there is
--   an identity.
module Control.Category.Associative

-- | A category with an associative bifunctor satisfying Mac Lane's
--   pentagonal coherence identity law:
--   
--   
--   bimap id associate . associate . bimap associate id = associate . associate
--   bimap disassociate id . disassociate . bimap id disassociate = disassociate . disassociate
--   
class Bifunctor p k k k => Associative (k :: Type -> Type -> Type) (p :: Type -> Type -> Type)
associate :: Associative k p => k (p (p a b) c) (p a (p b c))
disassociate :: Associative k p => k (p a (p b c)) (p (p a b) c)
instance Control.Category.Associative.Associative (->) GHC.Internal.Data.Either.Either
instance Control.Category.Associative.Associative (->) (,)

module Control.Category.Braided

-- | A braided (co)(monoidal or associative) category can commute the
--   arguments of its bi-endofunctor. Obeys the laws:
--   
--   
--   associate . braid . associate = second braid . associate . first braid
--   disassociate . braid . disassociate = first braid . disassociate . second braid
--   
--   
--   If the category is Monoidal the following laws should be satisfied
--   
--   
--   idr . braid = idl
--   idl . braid = idr
--   
--   
--   If the category is Comonoidal the following laws should be satisfied
--   
--   
--   braid . coidr = coidl
--   braid . coidl = coidr
--   
class Associative k p => Braided (k :: Type -> Type -> Type) (p :: Type -> Type -> Type)
braid :: Braided k p => k (p a b) (p b a)

-- | If we have a symmetric (co)Monoidal category, you get the
--   additional law:
--   
--   
--   swap . swap = id
--   
class Braided k p => Symmetric (k :: Type -> Type -> Type) (p :: Type -> Type -> Type)
swap :: Symmetric k p => k (p a b) (p b a)
instance Control.Category.Braided.Braided (->) GHC.Internal.Data.Either.Either
instance Control.Category.Braided.Braided (->) (,)
instance Control.Category.Braided.Symmetric (->) GHC.Internal.Data.Either.Either
instance Control.Category.Braided.Symmetric (->) (,)

-- | A Monoidal category is a category with an associated
--   biendofunctor that has an identity, which satisfies Mac Lane''s
--   pentagonal and triangular coherence conditions Technically we usually
--   say that category is Monoidal, but since most interesting
--   categories in our world have multiple candidate bifunctors that you
--   can use to enrich their structure, we choose here to think of the
--   bifunctor as being monoidal. This lets us reuse the same
--   Bifunctor over different categories without painful newtype
--   wrapping.
module Control.Category.Monoidal

-- | Denotes that we have some reasonable notion of Identity for a
--   particular Bifunctor in this Category. This notion
--   is currently used by both Monoidal and Comonoidal
--   
--   A monoidal category. idl and idr are traditionally
--   denoted lambda and rho the triangle identities hold:
--   
--   
--   first idr = second idl . associate
--   second idl = first idr . associate
--   first idr = disassociate . second idl
--   second idl = disassociate . first idr
--   idr . coidr = id
--   idl . coidl = id
--   coidl . idl = id
--   coidr . idr = id
--   
class Associative k p => Monoidal (k :: Type -> Type -> Type) (p :: Type -> Type -> Type) where {
    type Id (k :: Type -> Type -> Type) (p :: Type -> Type -> Type);
}
idl :: Monoidal k p => k (p (Id k p) a) a
idr :: Monoidal k p => k (p a (Id k p)) a
coidl :: Monoidal k p => k a (p (Id k p) a)
coidr :: Monoidal k p => k a (p a (Id k p))
instance Control.Category.Monoidal.Monoidal (->) GHC.Internal.Data.Either.Either
instance Control.Category.Monoidal.Monoidal (->) (,)

module Control.Category.Cartesian

-- | Minimum definition:
--   
--   
--   fst, snd, diag
--   fst, snd, (&&&)
--   
class (Symmetric k Product k, Monoidal k Product k) => Cartesian (k :: Type -> Type -> Type) where {
    type Product (k :: Type -> Type -> Type) :: Type -> Type -> Type;
}
fst :: Cartesian k => k (Product k a b) a
snd :: Cartesian k => k (Product k a b) b
diag :: Cartesian k => k a (Product k a a)
(&&&) :: Cartesian k => k a b -> k a c -> k a (Product k b c)
infixr 3 &&&

-- | free construction of Bifunctor for the product Bifunctor
--   Product k if (&&&) is known
bimapProduct :: Cartesian k => k a c -> k b d -> k (Product k a b) (Product k c d)

-- | free construction of Braided for the product Bifunctor
--   Product k
braidProduct :: Cartesian k => k (Product k a b) (Product k b a)

-- | free construction of Associative for the product
--   Bifunctor Product k
associateProduct :: Cartesian k => k (Product k (Product k a b) c) (Product k a (Product k b c))

-- | free construction of Disassociative for the product
--   Bifunctor Product k
disassociateProduct :: Cartesian k => k (Product k a (Product k b c)) (Product k (Product k a b) c)
class (Monoidal k Sum k, Symmetric k Sum k) => CoCartesian (k :: Type -> Type -> Type) where {
    type Sum (k :: Type -> Type -> Type) :: Type -> Type -> Type;
}
inl :: CoCartesian k => k a (Sum k a b)
inr :: CoCartesian k => k b (Sum k a b)
codiag :: CoCartesian k => k (Sum k a a) a
(|||) :: CoCartesian k => k a c -> k b c -> k (Sum k a b) c
infixr 2 |||

-- | free construction of Bifunctor for the coproduct
--   Bifunctor Sum k if (|||) is known
bimapSum :: CoCartesian k => k a c -> k b d -> k (Sum k a b) (Sum k c d)

-- | free construction of Braided for the coproduct Bifunctor
--   Sum k
braidSum :: CoCartesian k => k (Sum k a b) (Sum k b a)

-- | free construction of Associative for the coproduct
--   Bifunctor Sum k
associateSum :: CoCartesian k => k (Sum k (Sum k a b) c) (Sum k a (Sum k b c))

-- | free construction of Disassociative for the coproduct
--   Bifunctor Sum k
disassociateSum :: CoCartesian k => k (Sum k a (Sum k b c)) (Sum k (Sum k a b) c)
instance Control.Category.Cartesian.Cartesian (->)
instance Control.Category.Cartesian.CoCartesian (->)

module Control.Category.Distributive

-- | The canonical factoring morphism.
factor :: (Cartesian k, CoCartesian k) => k (Sum k (Product k a b) (Product k a c)) (Product k a (Sum k b c))

-- | A category in which factor is an isomorphism
class (Cartesian k, CoCartesian k) => Distributive (k :: Type -> Type -> Type)
distribute :: Distributive k => k (Product k a (Sum k b c)) (Sum k (Product k a b) (Product k a c))
instance Control.Category.Distributive.Distributive (->)

module Control.Category.Cartesian.Closed

-- | A CCC has full-fledged monoidal finite products and
--   exponentials
class Cartesian k => CCC (k :: Type -> Type -> Type) where {
    type Exp (k :: Type -> Type -> Type) :: Type -> Type -> Type;
}
apply :: CCC k => k (Product k (Exp k a b) a) b
curry :: CCC k => k (Product k a b) c -> k a (Exp k b c)
uncurry :: CCC k => k a (Exp k b c) -> k (Product k a b) c
unitCCC :: CCC k => k a (Exp k b (Product k b a))
counitCCC :: CCC k => k (Product k b (Exp k b a)) a

-- | A Co-CCC has full-fledged comonoidal finite coproducts and
--   coexponentials
class CoCartesian k => CoCCC (k :: Type -> Type -> Type) where {
    type Coexp (k :: Type -> Type -> Type) :: Type -> Type -> Type;
}
coapply :: CoCCC k => k b (Sum k (Coexp k a b) a)
cocurry :: CoCCC k => k c (Sum k a b) -> k (Coexp k b c) a
uncocurry :: CoCCC k => k (Coexp k b c) a -> k c (Sum k a b)
unitCoCCC :: CoCCC k => k a (Sum k b (Coexp k b a))
counitCoCCC :: CoCCC k => k (Coexp k b (Sum k b a)) a
instance Control.Category.Cartesian.Closed.CCC (->)
