Last active
September 3, 2016 17:30
-
-
Save expede/778e16658cd63c1ba0d4512b4e63edca 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
OtherFile.read("./existing_file.txt") | |
~> fn text -> | |
text | |
|> String.length | |
|> fn x -> x / 2 end.() | |
end.() | |
|> to_tagged_status | |
#=> {:ok, 500} | |
# `ok` alias for tagged_status | |
OtherFile.read("./missing.file") | |
~> fn text -> | |
text | |
|> String.length | |
|> fn x -> x / 2 end.() | |
end.() | |
|> ok | |
#=> {:error, "File not found at ./missing.file"} | |
# Operator | |
~~~OtherFile.read("./missing.file") | |
#=> {:error, "File not found at ./missing.file"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment