License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Dialg(F,G), the category of (F,G)-dialgebras and (F,G)-homomorphisms.
Synopsis
- data Dialgebra f g a where
- data Dialg f g a b where
- dialgId :: Dialgebra f g a -> Obj (Dialg f g) a
- dialgebra :: Obj (Dialg f g) a -> Dialgebra f g a
- type Alg f = Dialg f (Id (Dom f))
- type Algebra f a = Dialgebra f (Id (Dom f)) a
- type Coalg f = Dialg (Id (Dom f)) f
- type Coalgebra f a = Dialgebra (Id (Dom f)) f a
- type InitialFAlgebra f = InitialObject (Alg f)
- type TerminalFAlgebra f = TerminalObject (Coalg f)
- type Cata f a = Algebra f a -> Alg f (InitialFAlgebra f) a
- type Ana f a = Coalgebra f a -> Coalg f a (TerminalFAlgebra f)
- data NatNum
- primRec :: (() -> t) -> (t -> t) -> NatNum -> t
- data FreeAlg m = FreeAlg (Monad m)
- data ForgetAlg m = ForgetAlg
- eilenbergMooreAdj :: (Functor m, Dom m ~ k, Cod m ~ k) => Monad m -> Adjunction (Alg m) k (FreeAlg m) (ForgetAlg m)
Documentation
data Dialg f g a b where Source #
Arrows of Dialg(F,G) are (F,G)-homomorphisms.
DialgA :: (Category c, Category d, Dom f ~ c, Dom g ~ c, Cod f ~ d, Cod g ~ d, Functor f, Functor g) => Dialgebra f g a -> Dialgebra f g b -> c a b -> Dialg f g a b |
Instances
Category (Dialg f g) Source # | The category of (F,G)-dialgebras. |
HasInitialObject (Dialg (Tuple1 ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) ()) (DiagProd ((->) :: Type -> Type -> Type))) Source # | The category for defining the natural numbers and primitive recursion can be described as
|
Defined in Data.Category.Dialg initialObject :: Obj (Dialg (Tuple1 (->) (->) ()) (DiagProd (->))) (InitialObject (Dialg (Tuple1 (->) (->) ()) (DiagProd (->)))) Source # initialize :: Obj (Dialg (Tuple1 (->) (->) ()) (DiagProd (->))) a -> Dialg (Tuple1 (->) (->) ()) (DiagProd (->)) (InitialObject (Dialg (Tuple1 (->) (->) ()) (DiagProd (->)))) a Source # | |
type InitialObject (Dialg (Tuple1 ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) ()) (DiagProd ((->) :: Type -> Type -> Type))) Source # | |
Defined in Data.Category.Dialg type InitialObject (Dialg (Tuple1 ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) ()) (DiagProd ((->) :: Type -> Type -> Type))) = NatNum |
type InitialFAlgebra f = InitialObject (Alg f) Source #
The initial F-algebra is the initial object in the category of F-algebras.
type TerminalFAlgebra f = TerminalObject (Coalg f) Source #
The terminal F-coalgebra is the terminal object in the category of F-coalgebras.
type Cata f a = Algebra f a -> Alg f (InitialFAlgebra f) a Source #
A catamorphism of an F-algebra is the arrow to it from the initial F-algebra.
type Ana f a = Coalgebra f a -> Coalg f a (TerminalFAlgebra f) Source #
A anamorphism of an F-coalgebra is the arrow from it to the terminal F-coalgebra.
Instances
(Functor m, Dom m ~ k, Cod m ~ k) => Functor (FreeAlg m) Source # |
|
type Dom (FreeAlg m) Source # | |
Defined in Data.Category.Dialg | |
type Cod (FreeAlg m) Source # | |
Defined in Data.Category.Dialg | |
type (FreeAlg m) :% a Source # | |
Defined in Data.Category.Dialg |
Instances
(Functor m, Dom m ~ k, Cod m ~ k) => Functor (ForgetAlg m) Source # |
|
type Dom (ForgetAlg m) Source # | |
Defined in Data.Category.Dialg | |
type Cod (ForgetAlg m) Source # | |
Defined in Data.Category.Dialg | |
type (ForgetAlg m) :% a Source # | |
Defined in Data.Category.Dialg |