rec-def-0.2.2: Recursively defined values
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.POrder

Description

This module provides the POrder and related classes

Synopsis

Documentation

class POrder a where Source #

This class indicates that the type a is partially ordered by some relation ⊑.

The class does not actually have a method for ⊑, because we do not need it at runtime. Nevertheless the order better exists for the safety of this API.

This order may be unrelated to the total order given by Ord.

Methods

eqOfLe :: a -> a -> Bool Source #

The eqOfLe method checks _related_ elements for equality.

Formally: For all x ⊑ y, eqOfLe x y == True iff x == y.

This can be more efficient than testing for equality. For example for sets, (==) needs to compare the elements, but eqOfLe only needs to compare sizes. It is always ok to use (==) here.

Instances

Instances details
POrder Natural Source #

Ordered by '(<=)f'

Instance details

Defined in Data.POrder

Methods

eqOfLe :: Natural -> Natural -> Bool Source #

POrder Bool Source #

Arbitrary using the False < True order

Instance details

Defined in Data.POrder

Methods

eqOfLe :: Bool -> Bool -> Bool Source #

POrder a => POrder (Dual a) Source #

The dual order

Instance details

Defined in Data.POrder

Methods

eqOfLe :: Dual a -> Dual a -> Bool Source #

POrder (Set a) Source #

Ordered by subsetOf

Instance details

Defined in Data.POrder

Methods

eqOfLe :: Set a -> Set a -> Bool Source #

POrder a => POrder (Maybe a) Source #

Adds Nothing as a least element to an existing partial order

Instance details

Defined in Data.POrder

Methods

eqOfLe :: Maybe a -> Maybe a -> Bool Source #

class Bottom a where Source #

A class indicating that the type a is has a bottom element.

Methods

bottom :: a Source #

Instances

Instances details
Bottom Natural Source #

Bottom is 0

Instance details

Defined in Data.POrder

Bottom Bool Source #

Bottom is False

Instance details

Defined in Data.POrder

Methods

bottom :: Bool Source #

Top a => Bottom (Dual a) Source #

Bottom is the top of a

Instance details

Defined in Data.POrder

Methods

bottom :: Dual a Source #

Bottom (Set a) Source #

Bottom is empty

Instance details

Defined in Data.POrder

Methods

bottom :: Set a Source #

POrder a => Bottom (Maybe a) Source #

Bottom is Nothing

Instance details

Defined in Data.POrder

Methods

bottom :: Maybe a Source #

class POrder a => Top a where Source #

A class indicating that the type a is has a top element.

Methods

top :: a Source #

Instances

Instances details
Top Bool Source #

Top is True

Instance details

Defined in Data.POrder

Methods

top :: Bool Source #