Read a CSV file and convert it into list of tuples

Hey, I wanted to read a CSV file and convert it into a list of tuples and I come up with this:

    |> Path.expand(__DIR__)
    |> Stream.drop(1)
    |>, "\n"))
    |>, ","))
    |> -> {elem(Float.parse(List.first(pairs)), 0), elem(Float.parse(List.last(pairs)), 0)} end)

Is there any simpler and robust way to do this? How about the performance how can I improve it?

@azbshiri What you have seems largely fine although the formatting makes it a bit hard to read.

If you want optimal performance though use, it does a variety of things to result in optimal match performance.


Oh, thanks for the update.