Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created October 9, 2016 18:06
Show Gist options
  • Save boxxxie/4949ccb5cb5de0ad6ab367266fb54e9f to your computer and use it in GitHub Desktop.
Save boxxxie/4949ccb5cb5de0ad6ab367266fb54e9f to your computer and use it in GitHub Desktop.
in the below code, the is_map guard causes this code to take only that path, even when given a MapSet
def empty(%MapSet{}), do: MapSet.new()
def empty(obj) when is_map(obj), do: %{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment