Crowdhailer
Creator of Raxx
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention.
Assuming you have a double function with the spec double(int()) :: {:ok, int()} and safe dividing function. safe_div(int(), int()) :: {:ok, int()} | {:error, term()}.
Ok now can be used to create a pipeline that looks very much like the native pipe operator.
iex> {:ok, 6} ~>> safe_div(3) ~>> double
{:ok, 4.0}
iex> {:ok, 6} ~>> safe_div(0) ~>> double
{:error, :zero_division}
I have opened a pull request for this new version and pushed a release candidate. Hopefully it’s now interesting to people.
Trending in Announcing
WebAuthnLiveComponent WebAuthnComponents
See this post about renaming the package.
Passwordless authentication for Phoenix LiveView app...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
I’ll shortly be launching Text, a nascent text analysis library.
Current functionality
In this early version (not ready for prime time) ...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
ibgib
Very concise syntax for tagged fluent builder statements!
And I’m planning on more, slightly longer factory methods just like these and this helps clean things up very nicely. Thanks!
Crowdhailer
Thanks for the feedback. I haven’t really thought about the builder pattern in elixir, I normally have a great map I pass to a single function if need be but it’s certainly a nice usecase and one where you get to ensure that functions behave the way you want.
Crowdhailer
Version 0.2.0 released.
I will make a 1.0 release soon as there is almost no API to decide on. The one change that I think perhaps should be made is renaming the
OKmodule toOkso is follows mix patterns for capitalization?OvermindDL1
I’d recommend
Okas well as it is common vernacular now. However,OKis correct as it is short for (what is considered by etymologists(sp?)) Oll Korrekt, a vernacular of “All Correct” popularized in 1840’s New York (told to me by google ^.^).So, although I tend to use
Okmyself, technicallyOKis correct.Crowdhailer
Awesome tangential knowledge. I may well have to add some documentation to the effect of recording that.
brainbag
Someone wrote a great article about railway programming in Elixir. They used the
>>>operator but it’s quite similar!Here’s the link: Railway Oriented Programming in Elixir
mkunikow
Nice finding.

I assume this is based on article Railway oriented programming from great F# blog http://fsharpforfunandprofit.com/
Crowdhailer
Would you describe railway programming as a pattern or a technique.
I see that that article gives a bunch of examples on implementing the macros. My life would have been much easier if i had found that first.
Crowdhailer
Would you have a use for any of the other concepts, such as the tee. I haven’t noticed them missing from my code. I think it might be an 80/20 rule.
~>>gives the vast majority of the benefits and the rest are just minor improvementsbrainbag
Although I love the concept, I found some issues with the implementation in practice for user errors, which is where this pattern is intended to be used. In particular:
{:ok, :name, %metadata{}}which wouldn’t fit.Map.fetch/2for example just returns:error.:errorin context, I was doing it somewhere down the line. Often this meant I had to reconstruct context in order to provide a meaningful message to the UI.To resolve #1, I decided to change how it measured the results and tested either the
result == :error || elem(result, 0) == :error, and any other result was just passed through. This worked better for me and allowed for the shapes to be different. It could be expanded to capture more errors, but it still assumes that it would know all error conditions.Overall, after using it for a while, it felt more like I was using
try/catchor GOTO for flow control, which I am not fond of. I found it to basically be just a prettier but less comprehensible/usable version ofwith.I still love the idea of a flow chart for flow control, though!