tcalculus-1.0.0: A DSL prototype for structured realtime/reactive functional programing

Copyright(c) David Janin, 2015
Licensesee the LICENSE file in the distribution
Maintainerjanin@labri.fr
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Duration.POrd

Description

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).

Synopsis

Documentation

class POrd a where Source #

Partially ordered sets

Minimal complete definition

partialCompare | pLeq

Methods

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

Instances

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

Methods

partialCompare :: () -> () -> Maybe Ordering Source #

pLeq :: () -> () -> Bool Source #

pOrdEq :: () -> () -> Bool Source #

pOrdMin :: [()] -> Maybe () Source #

pOrdMax :: [()] -> Maybe () Source #

pOrdReduceMin :: [()] -> [()] Source #

pOrdReduceMax :: [()] -> [()] Source #

POrd Void Source # 
POrd Midi Source #

Definition of porder in midi

(Eq d, POrd v) => POrd [Atom d iv v] Source # 

Methods

partialCompare :: [Atom d iv v] -> [Atom d iv v] -> Maybe Ordering Source #

pLeq :: [Atom d iv v] -> [Atom d iv v] -> Bool Source #

pOrdEq :: [Atom d iv v] -> [Atom d iv v] -> Bool Source #

pOrdMin :: [[Atom d iv v]] -> Maybe [Atom d iv v] Source #

pOrdMax :: [[Atom d iv v]] -> Maybe [Atom d iv v] Source #

pOrdReduceMin :: [[Atom d iv v]] -> [[Atom d iv v]] Source #

pOrdReduceMax :: [[Atom d iv v]] -> [[Atom d iv v]] Source #

POrd a => POrd (Complete a) Source # 
POrd a => POrd (Max a) Source #

Derived partial order

Methods

partialCompare :: Max a -> Max a -> Maybe Ordering Source #

pLeq :: Max a -> Max a -> Bool Source #

pOrdEq :: Max a -> Max a -> Bool Source #

pOrdMin :: [Max a] -> Maybe (Max a) Source #

pOrdMax :: [Max a] -> Maybe (Max a) Source #

pOrdReduceMin :: [Max a] -> [Max a] Source #

pOrdReduceMax :: [Max a] -> [Max a] Source #

POrd a => POrd (Min a) Source #

Min completion as a pOrd.

Methods

partialCompare :: Min a -> Min a -> Maybe Ordering Source #

pLeq :: Min a -> Min a -> Bool Source #

pOrdEq :: Min a -> Min a -> Bool Source #

pOrdMin :: [Min a] -> Maybe (Min a) Source #

pOrdMax :: [Min a] -> Maybe (Min a) Source #

pOrdReduceMin :: [Min a] -> [Min a] Source #

pOrdReduceMax :: [Min a] -> [Min a] Source #

(POrd a, POrd b) => POrd (Either a b) Source #

Derived partial order for Either

Methods

partialCompare :: Either a b -> Either a b -> Maybe Ordering Source #

pLeq :: Either a b -> Either a b -> Bool Source #

pOrdEq :: Either a b -> Either a b -> Bool Source #

pOrdMin :: [Either a b] -> Maybe (Either a b) Source #

pOrdMax :: [Either a b] -> Maybe (Either a b) Source #

pOrdReduceMin :: [Either a b] -> [Either a b] Source #

pOrdReduceMax :: [Either a b] -> [Either a b] Source #

(POrd a, POrd b) => POrd (a, b) Source #

Derived partial order for Product

Methods

partialCompare :: (a, b) -> (a, b) -> Maybe Ordering Source #

pLeq :: (a, b) -> (a, b) -> Bool Source #

pOrdEq :: (a, b) -> (a, b) -> Bool Source #

pOrdMin :: [(a, b)] -> Maybe (a, b) Source #

pOrdMax :: [(a, b)] -> Maybe (a, b) Source #

pOrdReduceMin :: [(a, b)] -> [(a, b)] Source #

pOrdReduceMax :: [(a, b)] -> [(a, b)] Source #

(Num d, Ord d, Ord i) => POrd (Affine d i) Source #

Semantical partial order (with positive variables)

Methods

partialCompare :: Affine d i -> Affine d i -> Maybe Ordering Source #

pLeq :: Affine d i -> Affine d i -> Bool Source #

pOrdEq :: Affine d i -> Affine d i -> Bool Source #

pOrdMin :: [Affine d i] -> Maybe (Affine d i) Source #

pOrdMax :: [Affine d i] -> Maybe (Affine d i) Source #

pOrdReduceMin :: [Affine d i] -> [Affine d i] Source #

pOrdReduceMax :: [Affine d i] -> [Affine d i] Source #

(Num d, Ord d, Ord i) => POrd (Duration d i) Source # 
(Eq d, POrd v) => POrd (Atom d iv v) Source #

Derived natural partial order.

Methods

partialCompare :: Atom d iv v -> Atom d iv v -> Maybe Ordering Source #

pLeq :: Atom d iv v -> Atom d iv v -> Bool Source #

pOrdEq :: Atom d iv v -> Atom d iv v -> Bool Source #

pOrdMin :: [Atom d iv v] -> Maybe (Atom d iv v) Source #

pOrdMax :: [Atom d iv v] -> Maybe (Atom d iv v) Source #

pOrdReduceMin :: [Atom d iv v] -> [Atom d iv v] Source #

pOrdReduceMax :: [Atom d iv v] -> [Atom d iv v] Source #

(Num d, Eq d, POrd d, POrd v) => POrd (DQ d iv v) Source #

Derived natural partial order, possibly unfolding recursive definitions.

Methods

partialCompare :: DQ d iv v -> DQ d iv v -> Maybe Ordering Source #

pLeq :: DQ d iv v -> DQ d iv v -> Bool Source #

pOrdEq :: DQ d iv v -> DQ d iv v -> Bool Source #

pOrdMin :: [DQ d iv v] -> Maybe (DQ d iv v) Source #

pOrdMax :: [DQ d iv v] -> Maybe (DQ d iv v) Source #

pOrdReduceMin :: [DQ d iv v] -> [DQ d iv v] Source #

pOrdReduceMax :: [DQ d iv v] -> [DQ d iv v] Source #

(Num d, Eq d, POrd d, POrd v) => POrd (QList d iv v) Source #

Derived natural partial order, possibly unfolding recursive definitions.

Methods

partialCompare :: QList d iv v -> QList d iv v -> Maybe Ordering Source #

pLeq :: QList d iv v -> QList d iv v -> Bool Source #

pOrdEq :: QList d iv v -> QList d iv v -> Bool Source #

pOrdMin :: [QList d iv v] -> Maybe (QList d iv v) Source #

pOrdMax :: [QList d iv v] -> Maybe (QList d iv v) Source #

pOrdReduceMin :: [QList d iv v] -> [QList d iv v] Source #

pOrdReduceMax :: [QList d iv v] -> [QList d iv v] Source #

(Num d, Eq d, POrd d, POrd v) => POrd (Tile d iv v) Source #

Derived natural partial order, unfolds recursive definitions.

Methods

partialCompare :: Tile d iv v -> Tile d iv v -> Maybe Ordering Source #

pLeq :: Tile d iv v -> Tile d iv v -> Bool Source #

pOrdEq :: Tile d iv v -> Tile d iv v -> Bool Source #

pOrdMin :: [Tile d iv v] -> Maybe (Tile d iv v) Source #

pOrdMax :: [Tile d iv v] -> Maybe (Tile d iv v) Source #

pOrdReduceMin :: [Tile d iv v] -> [Tile d iv v] Source #

pOrdReduceMax :: [Tile d iv v] -> [Tile d iv v] Source #