Skip to content

Commit

Permalink
doc: improve lib.compareLists documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjobeki committed Dec 26, 2024
1 parent 08de518 commit a794e90
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/lists.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,13 @@ rec {
pairs);

/**
Compare two lists element-by-element.
Compare two lists element-by-element with a comparison function `cmp`.
List elements are compared in order, the first non-equal pair of elements determines the result.
With `cmp := (a: b: a < b)`, the result is the same as comparing `a < b` directly.
Therefore `compareLists` is a generalization of the `<` operator with a customizable comparison function.
See also https://nix.dev/manual/nix/stable/language/operators#comparison for more information.
# Inputs
Expand Down

0 comments on commit a794e90

Please sign in to comment.