Last active
September 7, 2016 14:40
-
-
Save bcardarella/e23c7e7ce6760a5af0f8ff1efdd0e1b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
opts = [with: %{name: "George"}] | |
acc = %{ | |
foo: %{ | |
columns: %{ | |
name: "Will" | |
} | |
} | |
} | |
with {:ok, override} <- Keyword.fetch(opts, :with), | |
{:ok, row} <- Map.fetch(acc, row_name), | |
{:ok, columns} <- Map.fetch(row, :columns) do | |
columns = Map.merge(columns, override) | |
put_in(acc, [row_name, :columns], columns) | |
else | |
:error -> acc |
chrismccord
commented
Sep 7, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment