Elixir lets me write this:
"Elixir rocks" |> String.upcase() |> String.split()
And I can introduce a function to combine the upcasing and the split:
upcase_split = fn (data) -> data |> String.upcase() |> String.split() end
"Elixir rocks" |> upcase_split()
Or
upcase_split_shorter = &(&1 |> String.upcase() |> String.split())
"Elixir rocks" |> upcase_split_shorter()
Is there a way to do this point-free? That is, without having to give a name to that first argument that I need to pass through the whole way?
This doesn't work:
nope = String.upcase() |> String.split()
but I was hoping there was something along those lines that might?