Stream: beginners

Topic: pipe operator


view this post on Zulip Wolfgang Schuster (Oct 18 2021 at 17:00):

@Richard Feldman I meant to ask the other day about why you chose to go with |> instead of . as the pipe operator? Especially considering I've seen Koka mentioned in the GitHub repo at least once or twice.

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:06):

|> indicates direction, and we already use . for record fields are two reasons

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:07):

we use reference counting tricks implemented in koka, and later found out they also do what we call "backpassing" but I have to admit I never actually ran any koka code

view this post on Zulip Lucas Rosa (Oct 18 2021 at 18:10):

|> being the pipe operator is fairly common for FP languages. Elixir and Elm are two off the top of my head

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:15):

purescript too I believe, at least you can use it there, f# is another example

view this post on Zulip Lucas Rosa (Oct 18 2021 at 18:43):

yea it's an extensive list :p

view this post on Zulip Lucas Rosa (Oct 18 2021 at 18:43):

. in haskell is function composition if I remember correctly

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:44):

yes

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:44):

interestingly, Clean uses the letter o for that purpose

view this post on Zulip Folkert de Vries (Oct 18 2021 at 18:44):

one of its many quirks

view this post on Zulip Wolfgang Schuster (Oct 18 2021 at 19:37):

I kinda guessed these were the reasons, but figured it was worth asking in case there was something else. Can likely add JS to the list of languages that use |> too once the proposal gets fully accepted

view this post on Zulip Richard Feldman (Oct 18 2021 at 20:17):

yeah, I think that one seems to be well on the road to standardization...except when it comes to argument order :sweat_smile:

view this post on Zulip Richard Feldman (Oct 18 2021 at 20:18):

|> in Elixir and Roc makes the preceding value be the first argument, whereas in Elm and F# it's the last argument. Last I heard, JS was debating between "first argument" and "explicit placeholder symbol for where you want it to go"

view this post on Zulip Lucas Rosa (Oct 18 2021 at 21:24):

In gleam because function arguments are labeled, it's accidentally arbitrary

view this post on Zulip Lucas Rosa (Oct 18 2021 at 21:25):

that wasn't planned, it was discovered after

view this post on Zulip Zeljko Nesic (Oct 19 2021 at 16:17):

This just popped up on Orange Website:
https://github.com/tc39/proposal-pipeline-operator


Last updated: Jul 05 2025 at 12:14 UTC