oalg-base-1.1.4.0: Algebraic structures on oriented entities and limits as a tool kit to solve algebraic problems.
Copyright(c) Erich Gut
LicenseBSD3
Maintainerzerich.gut@gmail.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

OAlg.Data.Ord

Contents

Description

Data.Ord enriched with some additional elements.

Synopsis

Total

module Data.Ord

fcompare :: Ord i => (a -> i) -> a -> a -> Ordering Source #

comparing according to the mapped values.

wcompare :: (w -> w -> Ordering) -> (a -> w) -> a -> a -> Ordering Source #

comparing according to the given ordering relation on the mapped values.

coCompare :: (a -> a -> Ordering) -> a -> a -> Ordering Source #

the reverse ordering

compare2 :: (a -> a -> Ordering) -> (b -> b -> Ordering) -> (a, b) -> (a, b) -> Ordering Source #

comparing of pairs.

sortFst :: Ord a => [(a, b)] -> [(a, b)] Source #

sorting according to the first component.

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

sorting according to the first component.

sortSnd :: Ord b => [(a, b)] -> [(a, b)] Source #

sorting according to the second component.

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

sorting according to the second component.

data Closer x Source #

the closer of a linear ordered x.

Constructors

NegInf 
It x 
PosInf 

Instances

Instances details
Read x => Read (Closer x) Source # 
Instance details

Defined in OAlg.Data.Ord

Show x => Show (Closer x) Source # 
Instance details

Defined in OAlg.Data.Ord

Methods

showsPrec :: Int -> Closer x -> ShowS #

show :: Closer x -> String #

showList :: [Closer x] -> ShowS #

Eq x => Eq (Closer x) Source # 
Instance details

Defined in OAlg.Data.Ord

Methods

(==) :: Closer x -> Closer x -> Bool #

(/=) :: Closer x -> Closer x -> Bool #

Ord x => Ord (Closer x) Source # 
Instance details

Defined in OAlg.Data.Ord

Methods

compare :: Closer x -> Closer x -> Ordering #

(<) :: Closer x -> Closer x -> Bool #

(<=) :: Closer x -> Closer x -> Bool #

(>) :: Closer x -> Closer x -> Bool #

(>=) :: Closer x -> Closer x -> Bool #

max :: Closer x -> Closer x -> Closer x #

min :: Closer x -> Closer x -> Closer x #

cmin :: Ord x => [x] -> Closer x Source #

the minimum of the items of a list, i.e. the biggest lower bound.

Property Let xs be in [x] for a linear ordered x, then holds: For all x in xs holds: cmin xs <= It x.

cmax :: Ord x => [x] -> Closer x Source #

the maximum of the items of a list, i.e. the smallest upper bound.

Property Let xs be in [x] for a linear ordered x, then holds: For all x in xs holds: It x <= cmax xs.

cspan :: Ord x => [x] -> Span x Source #

(l,u) = cspan xs where l is the minimum and u the maximum of the items in xs.

Example

>>> cspan "aeb"
(It 'a',It 'e')
>>> cspan ""
(PosInf,NegInf)

type Span x = (Closer x, Closer x) Source #

the span type.

enumSpan :: (Enum i, Ord i) => i -> Closer i -> [i] Source #

enumSpan i0 h enumerates the index, starting by i0 to h.

Partial

class Eq a => POrd a where Source #

partially ordered types.

Properties Let a be an instance of POrd, then holds:

  1. For all x in a holds: x <<= x.
  2. For all x, y in a holds: If x <<= y and y <<= x then x == y.
  3. For all x, y, z in a holds: If x <<= y and y <<= z then x <<= z.

Methods

(<<=) :: a -> a -> Bool infix 4 Source #

Instances

Instances details
Ord x => POrd (Set x) Source # 
Instance details

Defined in OAlg.Entity.Sequence.Set

Methods

(<<=) :: Set x -> Set x -> Bool Source #