News for hackers. Stuff that matters.
Re:Microfeatures I'd like to see in more languages by masklinn on Thursday January 05, 2023 @05:30PM (#34267818)
Elixir 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 "(&)".
Re:Microfeatures I'd like to see in more languages by int_19h on Friday January 06, 2023 @02:40AM (#34272013)
The earliest I've seen |> specifically in stdlib was in F#, which still predates Elixir by several years.
Re:Microfeatures I'd like to see in more languages by dmulligan on Friday January 06, 2023 @08:09AM (#34274207)
It was present in SML codebases earlier than F# (it's used everywhere in the Isabelle codebase, for example, and that's where I first came across it).