mayel
Provides OK-piping (similar to libraries like ok) and adds the ability to pipe into any argument position (similar to magritte) of the following function (or nested function). By inserting ... where you would like the value to be inserted, Arrows will override where it is placed.
This library was developed as part of the Bonfire project, which has some open bounties for any help improving performance: Bonfire Networks: An open-source framework for building federated digital spaces
So instead of only being limited to:
iex> 4 |> div(2)
2
You can also do:
iex> 4 |> div(2, ...)
0
Or even:
iex> 4 |> div(2, min(..., 1))
2
Links:
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
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
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
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
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
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
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Nefcairon
Ah, the three dots indicate where the object is put. Now I understand.
mayel
That’s right! The documentation do with a rewrite… (have now edited the description to mention that)
tomekowal
It is quite nice and readable
However, it is also not so hard to replace with Kernel.then/2
could become
mayel
Yeah this was created before
thenwas introduced, so probably not needed if you’re used to that syntax.hauleth
I see that the main difference between this and Magritte is that it do not have my limitations. Actually I have intentionally added these limitations to avoid things like:
Also, when you want to use
...twice within single pipe there is question whether there should be 2 separate parent pipes or single one. Aka whether this code:Should always return
true?I probably should have describe reasoning better in Magritte documentation.
mayel
Yeah that makes sense, though FWIW we’ve been happily using it without running into confusion on these topics so far.
In our case it pipes the same thing twice in that scenario:
jam
Thanks for making this package! The
~>looks like a nice alternative towith. Any gotchas or downsides to be aware of? Looks like it could always be used in place of the|>or are there still scenarios where you’d want to use|>?Also, would you mind documenting the other functions in more detail in the hex doc?
sodapopcan
withserves a very different purpose.<-is a match operator much like=with the difference that it returns the value of the expression if there is no match instead of raising.withis about running itsdoblock only when all of its clauses match. This package is just about being able to pipe into other positional arguments.Oops, sorry I misread what
~>was. There is another library like this that uses~>. My bad.mayel
I’ve added some more docs and examples: Arrows — arrows v0.2.1
Regarding
~>I tend to use it mostly for short pipes wherewithmay feel verbose, but for longer ones I prefer to be more explicit. In part because of this gotcha: