solutions/A Tour of Nix/17.nix

9 lines
319 B
Nix
Raw Normal View History

2024-04-16 19:13:00 -04:00
let
attrSetBonus = {f = {add = (x: y: x + y);
mul = (x: y: x * y);};
n = {one = 1; two = 2;};};
in
rec {
#Bonus: use only the attrSetBonus to solve this one
exBonus = 5 == attrSetBonus.f.add attrSetBonus.n.one ( attrSetBonus.f.add attrSetBonus.n.two attrSetBonus.n.two);
}