I’ve written the following code today:
branches = filter(strip.(readlines(`git branch --merged`))) do branch
branch != "master" && !startswith(branch, '*')
end
It’s OK, but I’d love to be able to write
branches = readlines(`git branch --merged`)
.|> strip
|> filter(branch -> branch != "master" && !startswith(branch, '*'))
end
as it reads better (reading order corresponds to evaluation order and “how I think about this” order).
I think that would be possible if Base provided a single-argument version of a filter function. I know I can add this myself, but I wonder why it isn’t provided out of the box?
Are there some performance concerns with returning partially-applied functions? Or is it just not what idiomatic Julia looks like?