Skip to content

Instantly share code, notes, and snippets.

@josevalim josevalim/gist:11173516
Last active Aug 29, 2015

Embed
What would you like to do?

Before

A map pattern will match any map that has the given keys and values. For example, %{"hello" => world} will match any map that has the key "hello". An empty map therefore matches all maps.

After

A map pattern will match any map that has all the keys specified in the pattern. The values for the matching keys must also match. For example, %{"hello" => world} will match any map that has the key "hello" and assign the value to world, while %{"hello" => "world"} will match any map that has the key "hello"with value equals to"world". An empty map pattern (%{}`) will match all maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.