HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulepartial-order-0.2.0.0Haskell2010

Data.PartialOrd

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.

  • 1 class
  • 5 values
classclass PartialOrd a where
#

Methods

  • (<=) :: a -> a -> Bool

    Less-than-or-equal relation.

  • (>=) :: a -> a -> Bool

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

  • (==) :: a -> a -> Bool

    Equality relation. Defined in terms of <=.

  • (/=) :: a -> a -> Bool

    Inequality relation. Defined in terms of ==.

  • (<) :: a -> a -> Bool

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

  • (>) :: a -> a -> Bool

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

  • compare :: a -> a -> Maybe Ordering

    Compare function, returning either Just an Ordering or Nothing.

Instances5PartialOrd
  • PartialOrd IntegerDefined in partial-order-0.2.0.0 · Data.PartialOrd
  • PartialOrd DoubleDefined in partial-order-0.2.0.0 · Data.PartialOrd
  • PartialOrd FloatDefined in partial-order-0.2.0.0 · Data.PartialOrd
  • PartialOrd IntDefined in partial-order-0.2.0.0 · Data.PartialOrd

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

  • PartialOrd a => PartialOrd [a]Defined in partial-order-0.2.0.0 · Data.PartialOrd

    Define the partial order in terms of the sublist relation.

valuemaxima :: PartialOrd a => [a] -> [a]
#

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

valueminima :: PartialOrd a => [a] -> [a]
#

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

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

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

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

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

valuenub :: PartialOrd a => [a] -> [a]
#

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