Just a random idea that keeps popping up in my head whenever I am pattern matching on maps. In Javascript es6 notation, there is this concept of a shorthand format to create objects, which I find very concise:
// pre es6
const someObject = {cat: cat, dog: dog, bird: bird}
// es6
const someObject = {cat, dog, bird}
Whenever I am pattern matching in Elixir I wonder how handy this would be to have, say:
def decorate_name(%{id, firstname, lastname}) do
"Hi, #{firstname} #{lastname}"
end
As opposed to
def decorate_name(%{id: id, firstname: firstname, lastname: lastname}) do
"Hi, #{firstname} #{lastname}"
end
Any thoughts?






















