!tDnwWRNkmmYtMXfaZl:nixos.org

Nix Language

1939 Members
Nix programming language359 Servers

Load older messages


SenderMessageTime
8 Jun 2021
@NYXT:matrix.orgdavidtwco joined the room.10:01:35
@artturin:matrix.orgArtturin joined the room.17:24:10
@emilazy:matrix.orgemily Buckley: no, but you can do e.g. pipe x [ f g h ] for f (g (h x)) 21:17:48
@emilazy:matrix.orgemily still need parens if f, g or h are themselves function applications (e.g. for passing multiple arguments) 21:17:59
@emilazy:matrix.orgemily er, that's lib.pipe from nixpkgs rather 21:18:04
@buckley310:matrix.orgBuckleyhmm, thats one to remember21:18:58
9 Jun 2021
@chrisawcom:matrix.orgchrisawcom joined the room.13:50:26
@toonn:matrix.orgtoonn That order of application is a little unintuitive, no? 16:49:00
@toonn:matrix.orgtoonn I'd expect that order for something named "compose." 16:49:11
@toonn:matrix.orgtoonn But pipe suggests shell pipes, going front to back. 16:49:33
@aaronjanse:matrix.orgaaronjanseI think that's what it does do?16:57:06
@aaronjanse:matrix.orgaaronjanseAt least if you think of x as an initial command to generate data (such as cat some/file/path)16:57:37
@aaronjanse:matrix.orgaaronjanseOh wait nvm, I see16:58:03
@sternenseemann:systemli.orgsterni
nix-repl> lib.pipe 12 [ (a: a + 12) (lib.const "lol") ]
"lol"

yep

16:58:06
@sternenseemann:systemli.orgsterni the expansion emily did had the wrong order h should have been the outermost call 16:58:32
@sternenseemann:systemli.orgsterni * the expansion emily did had the wrong order, h should have been the outermost call 16:58:57
@emilazy:matrix.orgemilywhoops, yes, sorry17:03:16
@emilazy:matrix.orgemilythe value coming first is definitely the weirdest thing :|17:03:47
@emilazy:matrix.orgemilythere's a comment right below it like "don't change this to have an order that would be useful, it'd be confusing"17:04:02
@sternenseemann:systemli.orgsternihaha17:04:23
@lunik1:lunik.onelunik1It's there a way to merge two attribute sets in the same manner as modules?20:18:19
@sternenseemann:systemli.orgsterni lunik1: it just uses // https://github.com/NixOS/nixpkgs/blob/83f6711464e03a856fb554693fe2e0f3af2ab0d5/lib/types.nix#L326-L332 20:20:41
@sternenseemann:systemli.orgsterniokay, options are merged differently though20:21:01
@sternenseemann:systemli.orgsterni you can just use the appropriate parts of lib/ probably 20:21:27
@lunik1:lunik.onelunik1yeah I mean options20:21:31
@lunik1:lunik.onelunik1 I think mkMerge has something to do with what I need, but I'm not quite sure what do do with the object it gives me... 21:04:44
10 Jun 2021
@noah:matrix.chatsubo.cafeChurch joined the room.04:29:38
@buckley310:matrix.orgBuckley

a module can be

{ lib, ... }:{ config = lib.mkMerge [ ]; }
05:26:44
@buckley310:matrix.orgBuckleyand then you just add your sets into the list05:27:02
@buckley310:matrix.orgBuckley lunik1: ^ 05:27:56

Show newer messages


Back to Room ListRoom Version: 6