HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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.

Synopsis
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.

Instances6PartialOrd
  • 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:

  • Ord a => PartialOrd (Set a)Defined in partial-order-0.2.0.0 · Data.PartialOrd

    Define the partial order in terms of the subset relation.

  • 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.

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

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