oalg-base-3.0.0.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

Description

Data.Ord enriched with some additional elements.

Synopsis

Documentation

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 Closure x Source #

the closer of a linear ordered x.

Constructors

NegInf 
It x 
PosInf 

Instances

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

Defined in OAlg.Data.Ord

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

Defined in OAlg.Data.Ord

Methods

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

show :: Closure x -> String #

showList :: [Closure x] -> ShowS #

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

Defined in OAlg.Data.Ord

Methods

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

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

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

Defined in OAlg.Data.Ord

Methods

compare :: Closure x -> Closure x -> Ordering #

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

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

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

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

max :: Closure x -> Closure x -> Closure x #

min :: Closure x -> Closure x -> Closure x #

Validable x => Validable (Closure x) Source # 
Instance details

Defined in OAlg.Data.Validable

Methods

valid :: Closure x -> Statement Source #

cmin :: Ord x => [x] -> Closure 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] -> Closure 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 = (Closure x, Closure x) Source #

the span type.

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

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