 | category-extras-0.50.3: Various modules and constructs inspired by category theory | Contents | Index |
|
Control.Functor.Algebra | Portability | non-portable (rank-2 polymorphism) | Stability | experimental | Maintainer | Edward Kmett <ekmett@gmail.com> |
|
|
|
Description |
Algebras, Coalgebras, Bialgebras, and Dialgebras and their (co)monadic
variants
|
|
Synopsis |
|
|
|
Documentation |
|
type Dialgebra f g a = f a -> g a |
F,G-dialgebras generalize algebras and coalgebraas
|
|
type GDialgebra f g w m a = f (w a) -> g (m a) |
|
type Bialgebra f g a = (Algebra f a, Coalgebra g a) |
F-G-bialgebras are representable by DiAlg (f :+: Identity) (Identity :+: g) a
and so add no expressive power, but are a lot more convenient.
|
|
type GBialgebra f g w m a = (GAlgebra f w a, GCoalgebra g m a) |
|
type Algebra f a = f a -> a |
F-Algebras
|
|
type GAlgebra f w a = f (w a) -> a |
F-W-Comonadic Algebras for a given comonad W
|
|
type Coalgebra f a = a -> f a |
F-Coalgebras
|
|
type GCoalgebra f m a = a -> f (m a) |
F-M-Monadic Coalgebras for a given monad M
|
|
liftAlgebra :: (Functor f, Comonad w) => Algebra f :~> GAlgebra f w |
Turn an F-algebra into a F-W-algebra by throwing away the comonad
|
|
liftCoalgebra :: (Functor f, Monad m) => Coalgebra f :~> GCoalgebra f m |
Turn a F-coalgebra into a F-M-coalgebra by returning into a monad
|
|
liftDialgebra :: (Functor g, Functor f, Comonad w, Monad m) => Dialgebra f g :~> GDialgebra f g w m |
|
fromCoalgebra :: Coalgebra f :~> Dialgebra Identity f |
|
fromAlgebra :: Algebra f :~> Dialgebra f Identity |
|
fromBialgebra :: Bialgebra f g :~> Dialgebra (f :*: Identity) (Identity :*: g) |
|
Produced by Haddock version 2.1.0 |