Created
July 24, 2017 19:43
-
-
Save PragTob/5b708fda67d2e0bbcd63a513390430e5 to your computer and use it in GitHub Desktop.
railway oriented programming
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
| 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