| 25 Oct 2025 |
llakala | my biggest issue was fixed recently, which i'm thankful for | 15:31:04 |
llakala | (strings with comments for injections don't get indented anymore | 15:31:19 |
llakala | * (strings with comments for injections don't get indented anymore) | 15:31:24 |
aftix | I use alejandra | 15:31:24 |
llakala | i can't deal with alejandra not putting spaces around list elements | 15:31:56 |
aftix | wdym? like between the first/last element and the brackets? | 15:33:30 |
llakala | before:
{
x = [ 1 ];
}
after:
{
x = [1];
}
| 15:34:38 |
Katalin 🔪 | that’s how lists are formatted pretty much in every other language though, I prefer that style. however I don’t like it not putting spaces inside {} haha | 15:48:45 |
piegames | you can't reasonably have that in Nix, unfortunately | 18:04:18 |
Katalin 🔪 | oh? why not? | 18:05:54 |
Katalin 🔪 | part of the parser design that makes this not work? apparently the parser is pretty cursed | 18:06:54 |
piegames | https://github.com/NixOS/rfcs/pull/148#issuecomment-3218177364 | 18:08:03 |
piegames | I think that can't work because functions don't have a dedicated start token, but not sure | 18:10:30 |
Katalin 🔪 | riiiight. | 18:15:26 |
piegames | I'm a bit wary of that, because in function chains you can do h . g . f a equivalently as h $ g $ f a, which doesn't matter too much in Haskell, but in Nix the former would lead to much worse error messages in case of type errors | 18:15:29 |
Katalin 🔪 | that sucks :( | 18:15:32 |
emily | this seems resolvable, right? f <| x: … is never valid syntax, so there is no ambiguity, even without changing the precedence | 18:16:51 |
emily | (but maybe annoying to make happen) | 18:16:54 |
emily | or do you just mean that |> and <| would become less symmetric? | 18:17:16 |
Katalin 🔪 | oh yeah, true. this is a different situation, because the one in your comment is actually valid right now | 18:17:54 |
piegames | that precise special case would work, but how does the rule generalize? How should f <| x: g <| h parse? | 19:04:23 |
emily | surely f (x: (g h)), since you certainly want to be able to use <| inside function bodies | 19:09:27 |
emily | same as f $ \x -> g $ h in Haskell | 19:09:37 |
emily | I mean… it can't be anything else unless you want <| to be left-associative | 19:09:51 |
piegames | ngl this feels wrong | 19:29:16 |
emily | thingy = callbackFn $ \result ->
if cond result then
123
else
f $ result
| 19:29:56 |
emily | would be pretty surprising for this to parse any other way | 19:30:06 |
emily | (unless f $ g $ x parsed as (f g) x in general) | 19:30:18 |
piegames | and how does & work there in Haskell? | 19:42:22 |
emily | same way, nothing inside \x -> … ever escapes, pretty much the same as in Nix | 19:45:47 |