logoalt Hacker News

Mawr • today at 10:41 AM • 1 reply • view on HN

> (a + b + c + d) * e

   a
   |> add(b)
   |> add(c)
   |> add(d)
   |> mult(e)
> mult(add(a, add(b, add(c, d))), e)

    c
    |> add(d)
    |> add(b, _)
    |> add(a, _)
    |> mult(e)

Replies

bennettnate5 • today at 1:38 PM

What a lovely pipe operator you have there to chain the functions and contribute to code readability :)