A |> B |> C second_param
Is the same as: C(B(A()), second_param)
It's much more powerful than that because you can create chains of functions that pipe their output i.e. Some_data
|> fetch_reports
|> email_users
|> setup_notifications
|> IO.inspect
|> affirm_elixir_pipes
It's 100% not the same as dot or arrow! IO.inspect allows you to print details of any data being passed but also returns the first argument passed.Hope this is a clear explanation of what is happening.
The pipe operator isn't Elixir's "novelty". Also, why is it better than the '.' syntax:
> fromFile(userInput).getLines.map(_.toUpperCase)
Do you get code completion for it as in an oop-ish language?