| 25 Oct 2025 |
Katalin 🔪 | In reply to @kfears:matrix.org I've seen you use backpipes, but I can't parse how it works at all essentially, they are equivalent to putting everything after them in parentheses, I think exactly like the haskell $ operator | 13:42:40 |
Katalin 🔪 | or, if not exactly, it’s close enough at a glance. I don’t write haskell lol | 13:43:22 |
Katalin 🔪 | yeah: https://wiki.haskell.org/$ | 13:44:36 |
KFears (burnt out) | So like foo bar (baz queux) is foo bar |> baz queux? | 13:45:11 |
KFears (burnt out) | But it only works with the last argument, because otherwise you still have to parenthesise? | 13:45:46 |
Katalin 🔪 | <|, but yeah | 13:46:18 |
Katalin 🔪 | adapting the example from the haskell wiki:
f <| g <| h x == f (g (h x))
f g h x == ((f g) h) x
| 13:47:57 |
emily | <| is also more "order-of-eval-correct" | 13:48:41 |
emily | (though (&) as flip ($) is also popular in Haskell – or was, back in my day…) | 13:48:52 |
emily | (I personally avoided using $ in Haskell for various reasons so I have little opinion on any of this other than to say what I'd really like in Nix is function composition operators) | 13:49:29 |
KFears (burnt out) | Interesting. Is it weird that I prefer parens? | 13:50:19 |
K900 | ~~lib.pipe~~ | 13:50:28 |
emily | parens can be ugly if you want something (x: …) (vs. something <| x: …) | 13:50:42 |
Katalin 🔪 | In reply to @emilazy:matrix.org parens can be ugly if you want something (x: …) (vs. something <| x: …) unfortunately the latter doesn’t actually parse right now :( | 13:51:05 |
Katalin 🔪 | I would really like that | 13:51:12 |
emily | in Haskell this often came up as
thingy = foopy $ do
…
as opposed to
thingy = foopy (do {
…
})
though they fixed it by just making foopy do work
| 13:51:27 |