Skip to content

Instantly share code, notes, and snippets.

@edennis
Created October 7, 2016 10:45
Show Gist options
  • Save edennis/171e8425b528d2dad614bb6930095801 to your computer and use it in GitHub Desktop.
Save edennis/171e8425b528d2dad614bb6930095801 to your computer and use it in GitHub Desktop.
pattern matching
iex(10)> m = %{a: 1}
%{a: 1}
iex(11)> %{a: 1} = %{a: 1, b: 2}
%{a: 1, b: 2}
iex(12)> ^m = %{a: 1, b: 2}
** (MatchError) no match of right hand side value: %{a: 1, b: 2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment