Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Created September 4, 2022 21:47
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 rugyoga/d57f40029d4b2fd2dfa7ba977e37a132 to your computer and use it in GitHub Desktop.
Save rugyoga/d57f40029d4b2fd2dfa7ba977e37a132 to your computer and use it in GitHub Desktop.
Three argument version of delta.
@spec delta(path(), any(), any()) :: delta_spec()
defp delta(path, a, b) when is_struct(a) and is_struct(b), do: delta_struct(path, a, b)
defp delta(path, a, b) when is_map(a) and is_map(b), do: delta_map(path, a, b)
defp delta(path, a, b) when is_list(a) and is_list(b), do: delta_list(path, a, b)
defp delta(path, a, b) when is_tuple(a) and is_tuple(b), do: delta_tuple(path, a, b)
defp delta(path, a, b), do: delta_simple(path, a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment