aboutsummaryrefslogtreecommitdiff
path: root/bin/tests/data/eta_reduction.nix
blob: e717ee724e7e6834d043f5862d0d76679edd6e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let
  double = x: x * 2;
  inherit (builtins) map;
  xs = [ 1 2 3 ];
  f = {
    inherit double;
    val = 2;
  };
in
[
  (map (x: double x) xs)

  # don't lint on non-free exprs
  (map (f: f.double f.val) [ f ])

  # other non-free forms
  (map (f: {inherit f;}.double f.val) [ f ])
]