Created
January 19, 2019 23:06
-
-
Save Tombarr/43d71a064dc8b5444be35472c469246d to your computer and use it in GitHub Desktop.
Map & Reduce in Elixir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1, 2, 3, 4, 5] | |
|> Enum.map(fn x -> x * x end) | |
|> Enum.reduce(fn x, s -> x + s end) # 55 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment