4 ms·
I was under the impression that Elixir introduced this.
by jbverschoor 4y ago
I was under the impression that Elixir introduced this.
- masklinn 4y agoElixir has forward pipes, but didn't invent them. For instance Racket and Clojure have threading macros, which are more flexible as they're just macros (Clojure's `->` is equivalent to Elixir's pipe operator, but `->>` will fill in the last parameter rather than first, and `-->` lets you use a keyword to define where the parameter is inserted in each call). Haskell let anyone who wants define their own pipe operator, historically you had to BYO, which wasn't exactly hard: (|>) = flip ($) or x |> f = f x would do (modulo fixity), but today it's provided by default as "(&)".