Skip to content

Instantly share code, notes, and snippets.

@gausby
Created September 11, 2016 13:33
Show Gist options
  • Save gausby/4392f2ba3b2703229a24bb3684ca035e to your computer and use it in GitHub Desktop.
Save gausby/4392f2ba3b2703229a24bb3684ca035e to your computer and use it in GitHub Desktop.
[1,0,1,1,1] |> Enum.reduce(0, fn
1, acc -> acc * 2 + 1
0, acc -> acc * 2
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment