Skip to content

Instantly share code, notes, and snippets.

@edmz
Last active May 1, 2016 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save edmz/e850f0e1b66614487177 to your computer and use it in GitHub Desktop.
Save edmz/e850f0e1b66614487177 to your computer and use it in GitHub Desktop.
Elixir version of[1] as revised by José Valim 1. http://devblog.avdi.org/2013/10/16/sorting-lines-in-5-languages/
# this version is by José Valim, my version was way more verbose and not quite as elixir-ish.
[input, output] = System.argv
File.write!(output, File.stream!(input) |> Enum.sort |> Enum.join(""))
@avdi
Copy link

avdi commented Oct 16, 2013

I'm pretty sure that could be taken care of using & notation.

@alco
Copy link

alco commented May 1, 2016

The |> Enum.join("") part is unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment