When using Stream you always have to use a function that collects the results at the end of the pipe because Stream functions only return other functions. Only when you put e.g. Enum.to_list or Stream.run in the end will the Stream functions in the pipe get executed.
Example:
"/path/to/file.csv"
|> File.stream!()
|> NimbleCSV.RFC41080.parse_stream()
|> Stream.map( ....... )
|> Enum.to_list()
Without the last function the code above only returns a function. Appending Enum.to_list forces that function to get executed. It’s how Stream works in Elixir and many other languages.
But be advised: using Stream incurs some performance penalty. Only use it if you have big collections of elements and you don’t want to have intermediate collections that get processed and then thrown away. Also it’s a good idea to only reach for Stream when you have several steps of processing. Your code above definitely does NOT need Stream as it is.






















