- class Semiring r => FreeAlgebra r a where
- join :: (a -> a -> r) -> a -> r

- class Semiring r => FreeCoalgebra r c where
- cojoin :: (c -> r) -> c -> c -> r

# Documentation

class Semiring r => FreeAlgebra r a whereSource

An associative algebra built with a free module over a semiring

FreeAlgebra () a | |

(FreeAlgebra r a, FreeAlgebra r b) => FreeAlgebra r (a, b) | |

(FreeAlgebra r a, FreeAlgebra r b, FreeAlgebra r c) => FreeAlgebra r (a, b, c) | |

(FreeAlgebra r a, FreeAlgebra r b, FreeAlgebra r c, FreeAlgebra r d) => FreeAlgebra r (a, b, c, d) | |

(FreeAlgebra r a, FreeAlgebra r b, FreeAlgebra r c, FreeAlgebra r d, FreeAlgebra r e) => FreeAlgebra r (a, b, c, d, e) | |

(FreeAlgebra r b, FreeAlgebra r a) => FreeAlgebra (b -> r) a |

class Semiring r => FreeCoalgebra r c whereSource

FreeCoalgebra () c | |

(FreeCoalgebra r a, FreeCoalgebra r b) => FreeCoalgebra r (a, b) | |

FreeAlgebra r m => FreeCoalgebra r (m -> r) | Every coalgebra gives rise to an algebra by vector space duality classically. Sadly, it requires vector space duality, which we cannot use constructively. This is the dual, which relies in the fact that any constructive coalgebra can only inspect a finite number of coefficients. |

(FreeCoalgebra r a, FreeCoalgebra r b, FreeCoalgebra r c) => FreeCoalgebra r (a, b, c) | |

(FreeCoalgebra r a, FreeCoalgebra r b, FreeCoalgebra r c, FreeCoalgebra r d) => FreeCoalgebra r (a, b, c, d) | |

(FreeCoalgebra r a, FreeCoalgebra r b, FreeCoalgebra r c, FreeCoalgebra r d, FreeCoalgebra r e) => FreeCoalgebra r (a, b, c, d, e) | |

(FreeAlgebra r b, FreeCoalgebra r c) => FreeCoalgebra (b -> r) c |