Copyright | (c) David Janin, 2015 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | janin@labri.fr |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
A class for preorder relations (reflexive and transitive relations) with associated equivalence. We use it for defining tile semantics (via natural preorder). This class can also be used for handling partial order relations (antisymetric preorder relations).
- class POrd a where
Documentation
Partially ordered sets
partialCompare :: a -> a -> Maybe Ordering Source #
A partial order relation. Though we do not require Eq a, we should have:
if (Eq a) then (a1 == a2) implies partialCompare a1 a2 == Just EQ
The converse may be false especially when Eq a is a "syntactic" equality as with [a].
pLeq :: a -> a -> Bool Source #
The Boolean version of the partial order.
pOrdEq :: a -> a -> Bool Source #
Derived equality:
pOrdEq a1 a2 = case partialCompare a1 a2 of Just EQ -> True _ -> False
pOrdMin :: [a] -> Maybe a Source #
Gets just the minimum of a list if it exists, nothing otherwise
pOrdMax :: [a] -> Maybe a Source #
Gets just the minimum of a list if it exists, nothing otherwise
pOrdReduceMin :: POrd a => [a] -> [a] Source #
Reduces a list to the antichain of its minimal elements
pOrdReduceMax :: POrd a => [a] -> [a] Source #
Reduces a list to the antichain of its maximal elements
POrd Char Source # | A total order on Char is a partial order |
POrd Int Source # | A total order on Int is a partial order |
POrd Integer Source # | A total order on Integer is a partial order |
POrd Rational Source # | A total order on Rational is a partial order |
POrd () Source # | A total order on () is a partial order |
POrd Void Source # | |
POrd Midi Source # | Definition of porder in midi |
(Eq d, POrd v) => POrd [Atom d iv v] Source # | |
POrd a => POrd (Complete a) Source # | |
POrd a => POrd (Max a) Source # | Derived partial order |
POrd a => POrd (Min a) Source # | Min completion as a pOrd. |
(POrd a, POrd b) => POrd (Either a b) Source # | Derived partial order for Either |
(POrd a, POrd b) => POrd (a, b) Source # | Derived partial order for Product |
(Num d, Ord d, Ord i) => POrd (Affine d i) Source # | Semantical partial order (with positive variables) |
(Num d, Ord d, Ord i) => POrd (Duration d i) Source # | |
(Eq d, POrd v) => POrd (Atom d iv v) Source # | Derived |
(Num d, Eq d, POrd d, POrd v) => POrd (DQ d iv v) Source # | Derived |
(Num d, Eq d, POrd d, POrd v) => POrd (QList d iv v) Source # | Derived |
(Num d, Eq d, POrd d, POrd v) => POrd (Tile d iv v) Source # | Derived |