Skip to content

Instantly share code, notes, and snippets.

@PragTob

PragTob/railway.ex

Created Jul 24, 2017
Embed
What would you like to do?
railway oriented programming
with {:ok, record} <- validate_data(params),
{:ok, record} <- validate_in_other_system(record),
{:ok, record} <- Repo.insert(record) do
{:ok, record}
else
{:error, changeset} -> {:error, changeset}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment