News for hackers. Stuff that matters.
Re:Pipelining might be my favorite programming language feature by agent281 on Monday April 21, 2025 @09:20PM (#43758241)
Isn't it being a method call not quite equivalent? Are you able to define the method over arbitrary data types?

In Elixir, it is just a macro so it applies to all functions. I'm only a Scala novice so I'm not sure how it would work there.

Re:Pipelining might be my favorite programming language feature by valenterry on Monday April 21, 2025 @09:24PM (#43758266)
> Are you able to define the method over arbitrary data types?

Yes exactly, which is why it is not equivalent. No macro needed here. In Scala 2 syntax:

``` implicit class AnyOps[A](private val a: A) extends AnyVal { def |>[B](f: A => B) = f(a) } ```