camfort-1.2.0: CamFort - Cambridge Fortran infrastructure
Copyright(c) 2016 Moritz Schulte
LicenseBSD3
Maintainermtesseract@silverratio.net
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Camfort.Specification.Stencils.PartialOrd

Description

This module provides the PartialOrd typeclass suitable for types admitting a partial order.

Along with the PartialOrd typeclass and some utility functions for working with partially ordered types, it exports implementations for the numeric types several numeric types, lists and sets.

Synopsis

Documentation

class PartialOrd a where Source #

Minimal complete definition

(<=)

Methods

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

Less-than-or-equal relation.

(>=) :: a -> a -> Bool Source #

Bigger-than-or-equal relation. Defined in terms of <=.

(==) :: a -> a -> Bool Source #

Equality relation. Defined in terms of <=.

(/=) :: a -> a -> Bool Source #

Inequality relation. Defined in terms of ==.

(<) :: a -> a -> Bool Source #

Less-than relation relation. Defined in terms of <= and /=.

(>) :: a -> a -> Bool Source #

Bigger-than relation. Defined in terms of <= and /=.

compare :: a -> a -> Maybe Ordering Source #

Compare function, returning either Just an Ordering or Nothing.

Instances

Instances details
PartialOrd Offsets Source # 
Instance details

Defined in Camfort.Specification.Stencils.Model

PartialOrd Integer Source # 
Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

PartialOrd Double Source # 
Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

PartialOrd Float Source # 
Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

PartialOrd Int Source #

Derive the partial order from the total order for the following types:

Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

Methods

(<=) :: Int -> Int -> Bool Source #

(>=) :: Int -> Int -> Bool Source #

(==) :: Int -> Int -> Bool Source #

(/=) :: Int -> Int -> Bool Source #

(<) :: Int -> Int -> Bool Source #

(>) :: Int -> Int -> Bool Source #

compare :: Int -> Int -> Maybe Ordering Source #

PartialOrd (Interval 'Standard) Source # 
Instance details

Defined in Camfort.Specification.Stencils.Model

Ord a => PartialOrd (Set a) Source #

Define the partial order in terms of the subset relation.

Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

Methods

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

(>=) :: Set a -> Set a -> Bool Source #

(==) :: Set a -> Set a -> Bool Source #

(/=) :: Set a -> Set a -> Bool Source #

(<) :: Set a -> Set a -> Bool Source #

(>) :: Set a -> Set a -> Bool Source #

compare :: Set a -> Set a -> Maybe Ordering Source #

PartialOrd a => PartialOrd [a] Source #

Define the partial order in terms of the sublist relation.

Instance details

Defined in Camfort.Specification.Stencils.PartialOrd

Methods

(<=) :: [a] -> [a] -> Bool Source #

(>=) :: [a] -> [a] -> Bool Source #

(==) :: [a] -> [a] -> Bool Source #

(/=) :: [a] -> [a] -> Bool Source #

(<) :: [a] -> [a] -> Bool Source #

(>) :: [a] -> [a] -> Bool Source #

compare :: [a] -> [a] -> Maybe Ordering Source #

PartialOrd a => PartialOrd (Vec n a) Source # 
Instance details

Defined in Camfort.Specification.Stencils.Model

Methods

(<=) :: Vec n a -> Vec n a -> Bool Source #

(>=) :: Vec n a -> Vec n a -> Bool Source #

(==) :: Vec n a -> Vec n a -> Bool Source #

(/=) :: Vec n a -> Vec n a -> Bool Source #

(<) :: Vec n a -> Vec n a -> Bool Source #

(>) :: Vec n a -> Vec n a -> Bool Source #

compare :: Vec n a -> Vec n a -> Maybe Ordering Source #

maxima :: PartialOrd a => [a] -> [a] Source #

Compute the list of all elements that are not less than any other element in the list.

minima :: PartialOrd a => [a] -> [a] Source #

Compute the list of all elements that are not bigger than any other element in the list.

elem :: (PartialOrd a, Foldable t) => a -> t a -> Bool Source #

Version of the traditional elem function using the PartialOrd notion of equality.

notElem :: (PartialOrd a, Foldable t) => a -> t a -> Bool Source #

Version of the traditional notElem function using the PartialOrd notion of equality.

nub :: PartialOrd a => [a] -> [a] Source #

Version of the traditional nub function using the PartialOrd notion of equality.