opvasger/comparable/2.0.0

Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/opvasger/comparable is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 2.0.0 found (60 same-name repos checked); no cached copy. Use another version.

Details

Comparable

This module contains replacements for functions that are imported by default.

Comparable

type alias Comparable value =
value -> value -> Order

A function to implement comparison for a given type of value.

default : Comparable comparable

The default implementation for comparison of values in Elm. This function implements equality as well as ordering for some types of values - Custom types aren't supported.

Basics

Basic functions with explicit comparison.

lt : Comparable value -> value -> value -> Bool

is the first value less than the second?

gt : Comparable value -> value -> value -> Bool

is the first value greater than the second?

lte : Comparable value -> value -> value -> Bool

is the first value less than or equal to the second?

gte : Comparable value -> value -> value -> Bool

is the first value greater than or equal to the second?

max : Comparable value -> value -> value -> value

return the greater of two values.

min : Comparable value -> value -> value -> value

return the lesser of two values.

List

List functions with explicit comparison.

maximum : Comparable value -> List value -> Maybe value

Find the maximum element in a non-empty list.

minimum : Comparable value -> List value -> Maybe value

Find the minimum element in a non-empty list.

sort : Comparable value -> List value -> List value

Sort values Comparable lowest to highest.