solutions/A Tour of Nix/32.nix

9 lines
196 B
Nix
Raw Normal View History

2024-04-16 19:13:00 -04:00
with import <nixpkgs> { };
let
attrSet = {c = 3; a = 1; b = 2;};
attrValues = s: map (field: s.${field}) (builtins.attrNames s);
in
rec {
solution = attrValues attrSet; #should be [1 2 3]
}