!9IQChSjwSHXPPWTa:lix.systems

Lix

1106 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-rooms295 Servers

Load older messages


SenderMessageTime
25 Oct 2025
@saiko:knifepoint.netKatalin 🔪sure, hold on12:57:39
@saiko:knifepoint.netKatalin 🔪https://git.dblsaiko.net/systems/tree/nixos/modules/sys2x/ssl.nix#n51 https://git.dblsaiko.net/systems/tree/configurations/whiprock/xmpp.nix#n1513:07:18
@kfears:matrix.orgKFears (burnt out)I've seen you use backpipes, but I can't parse how it works at all13:38:50
@cyborus:cartoon-aa.xyzCyborusNot to be confused with bagpipes13:40:09
@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
@kfears:matrix.orgKFears (burnt out)They are somewhat ugly, but they are universal, unlike the backpipe which only works on the last argument13:51:33
@emilazy:matrix.orgemily not sure if you could make f x: … work in Nix to mean f (x: …) 13:51:36
@emilazy:matrix.orgemily heh, in Haskell again a niche but existing opinion was that a $ b c $ d e should parse as a (b c) (d e) rather than a (b c (d e)), because you can achieve the latter as a . b c $ d e using the function composition operator 13:53:06
@emilazy:matrix.orgemily though of course Nix has no function composition operator so you'd have to turn it around into d e |> b c |> a 13:53:28
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud would need parens anyway for the body in any case that's not like… constant or the identity function, so i don't think it'd be particularly useful? 13:53:27
@emilazy:matrix.orgemily that is unfortunate and makes me think I'd never use <| 13:53:46
@emilazy:matrix.orgemily hm, why? you do have to decide how foo = f x: x + 2; parenthesizes, but f (x: x + 2) seems like almost invariably what you'd want in practice 13:54:22
@saiko:knifepoint.netKatalin 🔪
nix-repl> f <| x: x + 1
error: syntax error, expecting end of file
       at «string»:1:7:
            1| f <| x: x + 1
             |       ^

it seems like a bug to me

13:54:30
@saiko:knifepoint.netKatalin 🔪but who knows13:54:38
@emilazy:matrix.orgemily

in particular this would allow

stdenv.mkDerivation finalAttrs: {
  …
}
13:54:40

Show newer messages


Back to Room ListRoom Version: 10