Copyright | (c) 2016 Moritz Schulte |
---|---|
License | BSD3 |
Maintainer | mtesseract@silverratio.net |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
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.
- class PartialOrd a where
- maxima :: PartialOrd a => [a] -> [a]
- minima :: PartialOrd a => [a] -> [a]
- elem :: (PartialOrd a, Foldable t) => a -> t a -> Bool
- notElem :: (PartialOrd a, Foldable t) => a -> t a -> Bool
- nub :: PartialOrd a => [a] -> [a]
Documentation
class PartialOrd a where Source #
(<=) :: 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 #
PartialOrd Double Source # | |
PartialOrd Float Source # | |
PartialOrd Int Source # | Derive the partial order from the total order for the following types: |
PartialOrd Integer Source # | |
PartialOrd a => PartialOrd [a] Source # | Define the partial order in terms of the sublist relation. |
Ord a => PartialOrd (Set a) Source # | Define the partial order in terms of the subset relation. |
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.