aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/data/eta_reduction.nix
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-11-03 09:18:35 +0000
committerAkshay <[email protected]>2021-11-08 05:03:13 +0000
commit4e063b2abc402ac4d6902647e821978269025c7d (patch)
treea8935a5432fe86d0e5facb9ff8acc71edcb7f782 /bin/tests/data/eta_reduction.nix
parent78decf580d22fa792c19c40ace39762fb027067c (diff)
add snapshot test suitesnapshot-tests
Diffstat (limited to 'bin/tests/data/eta_reduction.nix')
-rw-r--r--bin/tests/data/eta_reduction.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/tests/data/eta_reduction.nix b/bin/tests/data/eta_reduction.nix
new file mode 100644
index 0000000..e717ee7
--- /dev/null
+++ b/bin/tests/data/eta_reduction.nix
@@ -0,0 +1,18 @@
1let
2 double = x: x * 2;
3 inherit (builtins) map;
4 xs = [ 1 2 3 ];
5 f = {
6 inherit double;
7 val = 2;
8 };
9in
10[
11 (map (x: double x) xs)
12
13 # don't lint on non-free exprs
14 (map (f: f.double f.val) [ f ])
15
16 # other non-free forms
17 (map (f: {inherit f;}.double f.val) [ f ])
18]