numhask-0.0.4: A numeric prelude

Safe HaskellNone
LanguageHaskell2010

NumHask.Algebra.Ordering

Contents

Description

A bit of extra Ordering taken from gaia.

Synopsis

lattice

class POrd s where Source #

P's just to avoid name clashes

Minimal complete definition

pcompare

Methods

pcompare :: s -> s -> POrdering Source #

Instances

Ord a => POrd a Source #

POrd

Methods

pcompare :: a -> a -> POrdering Source #

data POrdering Source #

Equal to, Less than, Greater than, Not comparable to

Constructors

PEQ 
PLT 
PGT 
PNC 

class POrd s => Topped s where Source #

Topped

Minimal complete definition

top

Methods

top :: s Source #

Instances

class POrd s => Bottomed s where Source #

Bottomed

Minimal complete definition

bottom

Methods

bottom :: s Source #

Instances

class (Topped a, Bottomed a) => Bounded a Source #

Replaces the Bounded in base. Is this a good idea?

class (Lattice a, Isomorphic (Inf a) (Sup a)) => Negated a where Source #

which creates a nice alternative for negate

Methods

negated :: a -> a Source #

class (Associative a, Commutative a, Idempotent a) => Semilattice a Source #

Semilattice

class (Coercible a (Sup a), Coercible a (Inf a), Semilattice (Sup a), Semilattice (Inf a), POrd a) => Lattice a where Source #

a nice Lattice, but the types explode the instance requirements

Associated Types

type Inf a Source #

type Sup a Source #

Methods

(/\) :: a -> a -> a Source #

(\/) :: a -> a -> a Source #

Instances

Lattice Double Source # 

Associated Types

type Inf Double :: * Source #

type Sup Double :: * Source #

Lattice Float Source # 

Associated Types

type Inf Float :: * Source #

type Sup Float :: * Source #

Methods

(/\) :: Float -> Float -> Float Source #

(\/) :: Float -> Float -> Float Source #

Lattice Int Source # 

Associated Types

type Inf Int :: * Source #

type Sup Int :: * Source #

Methods

(/\) :: Int -> Int -> Int Source #

(\/) :: Int -> Int -> Int Source #

Lattice Integer Source # 

Associated Types

type Inf Integer :: * Source #

type Sup Integer :: * Source #