mirror of
https://github.com/NixOS/nix.git
synced 2024-12-02 03:32:27 +00:00
efe4b690ae
functions that take a single argument (plain lambdas) into one AST node (Function) that contains a Pattern node describing the arguments. Current patterns are single lazy arguments (VarPat) and matching against an attribute set (AttrsPat). This refactoring allows other kinds of patterns to be added easily, such as Haskell-style @-patterns, or list pattern matching.
16 lines
123 B
Nix
16 lines
123 B
Nix
rec {
|
|
|
|
x = 123;
|
|
|
|
a = "foo";
|
|
|
|
b = "bar";
|
|
|
|
c = "foo" + "bar";
|
|
|
|
f = {z, x, y}: if y then x else z;
|
|
|
|
id = x: x;
|
|
|
|
}
|