!9IQChSjwSHXPPWTa:lix.systems

Lix

1102 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms292 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
25 Oct 2025
@saiko:knifepoint.netKatalin 🔪
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
@saiko:knifepoint.netKatalin 🔪or, if not exactly, it’s close enough at a glance. I don’t write haskell lol13:43:22
@saiko:knifepoint.netKatalin 🔪yeah: https://wiki.haskell.org/$13:44:36
@kfears:matrix.orgKFears (burnt out) So like foo bar (baz queux) is foo bar |> baz queux? 13:45:11
@kfears:matrix.orgKFears (burnt out)But it only works with the last argument, because otherwise you still have to parenthesise?13:45:46
@saiko:knifepoint.netKatalin 🔪<|, but yeah13:46:18
@saiko:knifepoint.netKatalin 🔪

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
@emilazy:matrix.orgemily <| is also more "order-of-eval-correct" 13:48:41
@emilazy:matrix.orgemily (though (&) as flip ($) is also popular in Haskell – or was, back in my day…) 13:48:52
@emilazy:matrix.orgemily (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:matrix.orgKFears (burnt out)Interesting. Is it weird that I prefer parens?13:50:19
@k900:0upti.meK900 ~~lib.pipe~~ 13:50:28
@emilazy:matrix.orgemily parens can be ugly if you want something (x: …) (vs. something <| x: …) 13:50:42
@saiko:knifepoint.netKatalin 🔪
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
@saiko:knifepoint.netKatalin 🔪I would really like that13:51:12
@emilazy:matrix.orgemily

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

Show newer messages


Back to Room ListRoom Version: 10