- Published on
Some of the many things I like from Elixir
- Authors
- Name
- Odee
{:ok, payload} = someAction()
# OR
{:error, info} = someAction()
Why is the above construct NOT as common in other languages? Hmmm, maybe they are, i might just be unaware.
Above or something akin to the Railway Oriented Programming (ROP) would be a real neat addition to your project's conventions.
There is a lot of things I like about Elixir, you know, OTP and stuff. And when working on non-elixir projects, I often find myself looking-for/reimplementing some very simple things that are second nature when on ElixirLand.
(1) One of them would be what is shown above; and
(2) another would be Ecto
's changesets
.
I'll leave them details to your googling skills, but i'd like to add that it is also somewhat similar to the spirit of the Parse, don’t validate
mantra, which I first encountered from colinhacks/zod
's readme referencing this article. go take a read.