Skip to content

Instantly share code, notes, and snippets.

@pkoch
Created May 8, 2017 18:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkoch/3707c0610ce06c53310dcbb99a82aeaa to your computer and use it in GitHub Desktop.
Save pkoch/3707c0610ce06c53310dcbb99a82aeaa to your computer and use it in GitHub Desktop.
defmodule Derp do
def project(map, args) do
map
|> Map.take(args)
for k <- args, do: map[k]
end
end
IO.inspect Derp.project(%{a: 1, b: 2}, [:b, :a])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment