I think your problem lies in the fact that you're calling Stream.map
without parentheses, and then try to pipe. I must admit, I'm not sure of the mechanics, but your original call seems to be interpreted as:
1..10 |> Stream.map(&(&1 * &1) |> Enum.to_list)
I would rewrite this to use parens in the function call:
1..10 |> Stream.map(&(&1 * &1)) |> Enum.to_list
Personally, I mostly use parens in function calls. The exceptions to this are zero arg function calls, macro calls, and occasional IO.puts/inspect calls (which I usually do just for debugging purposes).
I find this approach to be very helpful, in particular when piping, because it removes possible ambiguities.