diff --git a/15.nix b/15.nix new file mode 100644 index 0000000..3db6c09 --- /dev/null +++ b/15.nix @@ -0,0 +1,18 @@ +with import { }; +with stdenv.lib; +let + attr = {a="a"; b = 1; c = true;}; + s = "b"; +in +{ + #replace all X, everything should evaluate to true + ex0 = isAttrs attr; + ex1 = attr.a == "a"; + ex2 = attr.${s} == 1; + ex3 = attrVals ["c" "b"] attr == [ true 1 ]; + ex4 = attrValues attr == [ "a" 1 true ]; + ex5 = builtins.intersectAttrs attr {a="b"; d=234; c="";} + == { a = "b"; c = "";}; + ex6 = removeAttrs attr ["b" "c"] == { a="a"; }; + ex7 = ! attr ? a == false; +} \ No newline at end of file