Background
I had a situation this morning where I wanted to pass a function into a reduce which only made use of the accumulator, ie the 2nd argument. Initially I wrote it using the `fn` syntax, ie:
1..n |> Enum.reduce(a, fn (_ , acc) -> do_stuff(acc) end)
however I wanted to be able to be able to use an ampersand expression function (is there a proper name for this?) like this:
1..n |> Enum.reduce(a, &do_stuff(&2))
however, the compiler told me:
capture &2 cannot be defined without &1
ProposalWould it make sense for the compiler to treat all unused &n (up to the maximum which is defined) as being _ arguments?
for example: