Skip to content

Instantly share code, notes, and snippets.

@Tombarr
Created January 19, 2019 23:02
Show Gist options
  • Save Tombarr/20fce983fb7b53e294d1dd45dfd8aa8a to your computer and use it in GitHub Desktop.
Save Tombarr/20fce983fb7b53e294d1dd45dfd8aa8a to your computer and use it in GitHub Desktop.
Destructuring using pattern matching in Elixir
[x, y, z] = [1, 2, 3]
{status, message} = {:error, "Unknown error"}
[first | everythingElse] = [1, 2, 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment