Skip to content

Instantly share code, notes, and snippets.

@rugyoga
Created September 4, 2022 21:49
Take delta of two structs
@spec delta_struct(path(), struct(), struct()) :: delta_spec()
def delta_struct(path, %a_s{} = a, %b_s{} = b) when a_s != b_s, do: delta_simple(path, a, b)
def delta_struct(path, a, b), do: delta_map(path, Map.from_struct(a), Map.from_struct(b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment