mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 15:41:48 +00:00
599015e8b0
mess. Also cleaned up some functions: - foldl appeared broken (it recursively called fold). - Renamed logicalAND/logicalOR to and/or. - Removed listOfListsToAttrs, eqStrings: obsolete. - Removed isInList, which does the same thing as elem. - stringToCharacters: don't return a "" at the end of the list. - Renamed concatList to concat, as concatList (singular) is a misnomer: it takes two lists. Likewise, renamed mergeAttr to mergeAttrs. misc.nix still contains a lot of stuff that should be refactored and moved to other files. svn path=/nixpkgs/trunk/; revision=14013
19 lines
362 B
Nix
19 lines
362 B
Nix
rec {
|
|
|
|
# Identity function.
|
|
id = x: x;
|
|
|
|
# Constant function.
|
|
const = x: y: x;
|
|
|
|
# Named versions corresponding to some builtin operators.
|
|
concat = x: y: x ++ y;
|
|
or = x: y: x || y;
|
|
and = x: y: x && y;
|
|
mergeAttrs = x : y : x // y;
|
|
|
|
# Take a function and evaluate it with its own returned value.
|
|
fix = f: let result = f result; in result;
|
|
|
|
}
|