Partially ordered data types. The standard Ord
class is for
total orders and therefore not suitable for floating point. However, we can
still define meaningful max
and sort
functions for these types.
We define a PosetOrd
class which extends Ord
by adding
a NComp
constructor representing that two elements are
incomparable.
Documentation
class Eq a => Poset a whereSource
Class for partially ordered data types. Instances should satisfy the following laws for all values a, b and c:
But note that the floating point instances don't satisfy the first rule.
Minimal definition: posetCmp or leq.
Are two elements of the underlying comparabale or not; if they are, then Ordering tell the relation between them.