:: Ord a => [a] -> [a] package:daml-stdlib -is:exact is:exact
The `sort` function implements a stable sorting algorithm. It is
a special case of `sortBy`, which allows the programmer to supply
their own comparison function.
Elements are arranged from lowest to highest, keeping duplicates in
the order they appeared in the input (a stable sort).
`dedup l` removes duplicate elements from a list. In particular,
it keeps only the first occurrence of each element. It is a
special case of `dedupBy`, which allows the programmer to supply
their own equality test.
`dedup` is called `nub` in Haskell.
The `dedupSort` function sorts and removes duplicate elements from a
list. In particular, it keeps only the first occurrence of each
element.
`dedup l` removes duplicate elements from a list. In particular,
it keeps only the first occurrence of each element.
`dedup` is stable so the elements in the output are ordered
by their first occurrence in the input. If you do not need
stability, consider using `dedupSort` which is more efficient.
```
>>> dedup [3, 1, 1, 3]
[3, 1]
```
`dedupSort` is a more efficient variant of `dedup`
that does not preserve the order of the input elements.
Instead the output will be sorted acoording to the builtin Daml-LF
ordering.
```
>>> dedupSort [3, 1, 1, 3]
[1, 3]
```
Sort the list according to the Daml-LF ordering.
Values that are identical according to the builtin Daml-LF ordering
are indistinguishable so stability is not relevant here.
```
>>> sort [3,1,2]
[1,2,3]
```
Extract the elements after the head of a list, which must be
non-empty.
Return all the elements of a list except the last one. The list
must be non-empty.
List of elements of a structure, from left to right.