Sometimes I have a pipeline that creates a function and I'd like to eventually apply the resulting function at a given argument, is there an idiomatic way to achieve this behaviour?
For instance, this works:
let neato = 1 |> int.is_even
However, sometimes I have the other way around (namely with higher-order functions in the pipeline):
let negate = fn(p) { fn(x) { !p(x) } }
let oh_no = int.is_even |> negate |> fn(f) { f(1) }
I dislike having to use the fn here, and I'd like to have something like:
let _i_wish = int.is_even |> negate |> _(1) // 💢 Invalid Gleam
Thanks!
