Basis entryBasics.compare
Static basis
Dynamic basis
Tests (19)
- elm / FloatEdgeTestFloat edge cases: `round` on halves, NaN in equality, `min` and `compare`, `truncate` of NaN, and an Int power beyond 2^32.
- elm / StandardCoreEvaluationExamplesTestSmall programs for rules of the dynamic semantics of the Core that other tests reach only in passing, and examples from the Comments of A Standard Definition of Elm?, Chapter 6.
- elm-core / CompareCharTest`compare` on `Char` returns `LT`, `GT` or `EQ` by character code.
- elm-core / CompareCustomWithEmptyListFieldTestOrdering and equality of a custom type whose `List Int` field may be empty.
- elm-core / CompareEmptyListTest`compare` on `List Int` values, including the empty list.
- elm-core / CompareEmptyStringTest`compare` on `String` values, including the empty string.
- elm-core / CompareFloatTest`compare` on `Float` returns `LT`, `GT` and `EQ` for less, greater and equal operands.
- elm-core / CompareIntTest`compare` on `Int` returns `LT`, `GT` and `EQ` for less, greater and equal operands.
- elm-core / CompareNestedEmptyListTest`compare` on `List (List Int)` values where some inner lists are empty.
- elm-core / CompareRecordWithEmptyListFieldTestOrdering and equality of a record whose `List Int` field may be empty.
- elm-core / CompareStringTest`compare` on `String` returns `LT`, `GT` and `EQ` for strings that are less than, greater than and equal to one another, comparing character codes from the first character.
- elm-core / CompareTupleWithEmptyListNestedTest`compare` on tuples nested two deep whose `List Int` field may be empty.
- elm-core / CompareTupleWithEmptyListTest`compare` on pairs whose `List Int` field may be empty.
- elm-core / CompareTupleWithEmptyStringTest`compare` on pairs whose `String` field may be empty.
- elm-core / ContainerCompareCharTestOrdering of pairs, triples and lists of `Char` with `compare` and the relational operators.
- elm-core / ContainerCompareIntTestOrdering of pairs, triples and lists of `Int` with `compare` and the relational operators.
- elm-core / StandardA46CompareNanTest`compare` is a total order on Float: NaN is above every other float and equal to NaN.
- elm-core / StandardA53CharOrderTestCharacters are ordered by their code points.
- elm-core / StandardA53StringOrderTestStrings are ordered character by character, by code point.
Discussions
Discuss this basis entry·Search the discussions on GitHub
Discussions are on GitHub; one about this basis entry has [b:Basics.compare] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.