Copyright | (c) Andrey Mokhov 2016-2018 |
---|---|
License | MIT (see the file LICENSE) |
Maintainer | andrey.mokhov@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Alga is a library for algebraic construction and manipulation of graphs in Haskell. See this paper for the motivation behind the library, the underlying theory, and implementation details.
This module provides basic data types and type classes for representing edge labels in edge-labelled graphs, e.g. see Algebra.Graph.Labelled.
Synopsis
- class Semilattice a where
- class Semilattice a => Dioid a where
- data Distance a
Type classes for edge labels
class Semilattice a where Source #
A bounded join semilattice, satisfying the following laws:
Commutativity:
x \/ y == y \/ x
Associativity:
x \/ (y \/ z) == (x \/ y) \/ z
Identity:
x \/ zero == x
Idempotence:
x \/ x == x
Instances
Semilattice Bool Source # | |
Ord a => Semilattice (Set a) Source # | |
Ord a => Semilattice (Distance a) Source # | |
class Semilattice a => Dioid a where Source #
A dioid is an idempotent semiring, i.e. it satisfies the following laws:
Associativity:
x /\ (y /\ z) == (x /\ y) /\ z
Identity:
x /\ one == x one /\ x == x
Annihilating zero:
x /\ zero == zero zero /\ x == zero
Distributivity:
x /\ (y \/ z) == x /\ y \/ x /\ z (x \/ y) /\ z == x /\ z \/ y /\ z
Data types for edge labels
Instances
Eq a => Eq (Distance a) Source # | |
(Ord a, Num a) => Num (Distance a) Source # | |
Defined in Algebra.Graph.Label | |
Ord a => Ord (Distance a) Source # | |
Show a => Show (Distance a) Source # | |
(Num a, Ord a) => Dioid (Distance a) Source # | |
Ord a => Semilattice (Distance a) Source # | |