!9IQChSjwSHXPPWTa:lix.systems

Lix

1086 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-rooms296 Servers

Load older messages


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.cloudwhispers 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.cloudwhispers 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
@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
*
13:56:51
@dawnofmidnight:catgirl.cloudwhispers ah right, i forgot that this would be unambiguous. blocks are compelling (though i personally don't think it justifies the whole thing) 13:57:08
@dawnofmidnight:catgirl.cloudwhispers * ah right, i forgot that this would be there. blocks are compelling (though i personally don't think it justifies the whole thing) 13:57:15
@emilazy:matrix.orgemily mostly it's the main thing I can imagine wanting <| for 13:57:31
@emilazy:matrix.orgemily though not sure how I feel about stdenv.mkDerivation <| finalAttrs: …, that seems comparably noisy to the parens again :) 13:58:05
@emilazy:matrix.orgemily

the parens only really annoy me a bunch when they make nixfmt do something I hate, like

foo (
  a: b:
  …
)
13:58:33
@emilazy:matrix.orgemilyavoiding rightward drift of entire file bodies can require some unpleasant contortions13:59:02
@emilazy:matrix.orgemilyI ruled out several draft ideas for improvements to Nixpkgs package structure just because they would add another layer of indentation to every single package 😅14:00:33
@llakala:matrix.orgllakalai still don't use a formatter for my config because i can't stand any of them15:25:10
@llakala:matrix.orgllakalanixfmt is addicted to indentation15:25:16
@llakala:matrix.orgllakalai generally think nixfmt is good at what it was designed for (being a nixpkgs formatter)15:26:18
@llakala:matrix.orgllakala

but little things, like this:

{ lib, pkgs, config, ... }:

becoming this:

{
  lib,
  pkgs,
  config,
  ...
}:
15:29:00
@llakala:matrix.orgllakala

and this:

let
  # let content
in {

becoming this:

let
  # let content
in
{
15:30:21
@llakala:matrix.orgllakalaare the kind of things i can't stand15:30:35

Show newer messages


Back to Room ListRoom Version: 10