Qqwy

Qqwy

TypeCheck Core Team

Inspired by this topic I thought it might be interesting to talk about what pipelines we have encountered in the wild:

  • Whenever you come across a piece of code featuring a pipeline that you think is cool or elegant, feel free to share.
  • Also, feel free to share code snippets in which you feel that it might have been better not to use a pipeline but another abstraction.
  • And feel free to politely comment on and discuss the submissions written by other posters. Do you agree/disagree? What would you have done differently? :slight_smile:

Note: A with-chain can also be considered a kind of pipeline and be posted here, if you’d like.


All right, let’s start off:

This is a very simple example, part of the tensor library (for vectors, matrices and higher-dimension tensors) that I wrote a couple of years back.
What I like about this pipeline, is that is very clear to the reader what is going on. In most other languages, this would have to be written either in one line, or by using a temporary variable with probably a hard-to-choose name. The only other, non-pipeline approach I see, is to introduce an as_transposed wrapper that takes a function pointer, and does both the transposition and back under the hood. Maybe that’s nice for some other languages, but in Elixir, where we have this potential to produce pipelines (aliteration intended), it is definitely overkill.

First Post! Switch mode

OvermindDL1

OvermindDL1

Honestly most ‘beautiful’ uses of pipelines involves not changing the underlying container ‘type’ of the value being piped. Although I do a lot of transforming like that in mine, it is indeed harder to follow. Basically using pipes as a monad is the easiest to follow and read, that is really why I think that the monad concept should have been baked into pipelines to help enforce that.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New

Other Trending Topics Top

JesseHerrick
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
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement