Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pragdave/exlibris
https://github.com/pragdave/exlibris
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pragdave/exlibris
- Owner: pragdave
- License: mit
- Created: 2014-11-02T04:59:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-02T19:15:08.000Z (about 10 years ago)
- Last Synced: 2024-10-10T18:41:29.507Z (2 months ago)
- Language: Elixir
- Size: 110 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A collection of random library functions. (Miscellaneous)
- fucking-awesome-elixir - exlibris - A collection of random library functions. (Miscellaneous)
- awesome-elixir - exlibris - A collection of random library functions. (Miscellaneous)
README
Exlibris
========A collection of random functions that I've used in more than one project:
* **pipe_while_ok**
Create pipelines that terminate early if any step fails to return a
tuple that starts `{:ok, ...}`* **before_returning**
Like Ruby's `returning`, it evaluates its first argument, then evaluates the
`do` block. It always returns the value of its first argument.The `do` block is like the body of a `case`, in that it receives the value
of the first argument and patterns matches on it.before_returning File.open(name) do
{:ok, _file} -> Logger.debug("#{name} opened OK")
{:error, reason} -> Logger.error("Opening #{name}: #{:file.format_error(reason)}")
end