!9IQChSjwSHXPPWTa:lix.systems

Lix

1103 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 🔪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
@emilazy:matrix.orgemily basically you would get trailing "block" syntax. not saying this is something that should be done, just you could do it, and it would make some things look a fair bit nicer 13:55:14
@emilazy:matrix.orgemily(though ofc the Nix grammar is cursed enough that it might expose other gremlins)13:56:01
@dawnofmidnight:catgirl.cloud@dawnofmidnight:catgirl.cloud that's the case i was thinking of, (f x: x) + 2 is a perfectly interpretation. i suppose you could say it consumes as much as possible, but that is sort of contrary to the behavior of say, [ f x ] where you don't consume more (though whether this is analogous is debatatable). you can absolutely define it to be that, but i feel like it would break precedent? dunno 13:56:32
@saiko:knifepoint.netKatalin 🔪
In reply to @kfears:matrix.org
They are somewhat ugly, but they are universal, unlike the backpipe which only works on the last argument
sure, but often you do specifically end up with lots of long expression as specifically the last parameter
13:56:43

Show newer messages


Back to Room ListRoom Version: 10