News for hackers. Stuff that matters.
Re:Pipelining might be my favorite programming language feature by manmal on Monday April 21, 2025 @04:37PM (#43756201)
I wish there were a variation that can destructure more ergonomically.

Instead of:

```

fetch_data()

|> (fn

  {:ok, val, _meta} -> val

  :error -> "default value"
end).()

|> String.upcase()

```

Something like this:

```

fetch_data()

|>? {:ok, val, _meta} -> val

|>? :error -> "default value"

|> String.upcase()

```

Re:Pipelining might be my favorite programming language feature by smallerize on Monday April 21, 2025 @08:27PM (#43757928)

  fetch_data()
  |> case do
      {:ok, val, _meta} -> val
      :error -> "default value"
  end
You have the extra "case do...end" block but it's pretty close?

This is for sequential conditions. If you have nested conditions, check out a where block instead. https://dev.to/martinthenth/using-elixirs-with-statement-5e3...

Re:Pipelining might be my favorite programming language feature by manmal on Tuesday April 22, 2025 @01:27PM (#43764417)
Thanks, that looks good!