From 9656e7e52c6181a8a96d4130537867c53a9d25cd Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 14 Apr 2022 10:18:01 +0000 Subject: [PATCH] Add '16.nix' --- 16.nix | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 16.nix diff --git a/16.nix b/16.nix new file mode 100644 index 0000000..74fafd7 --- /dev/null +++ b/16.nix @@ -0,0 +1,9 @@ +let + list = [ { name = "foo"; value = 123; } + { name = "bar"; value = 456; } ]; + string = ''{"x": [1, 2, 3], "y": null}''; +in +{ + ex0 = builtins.listToAttrs list == { foo = 123; bar = 456; }; + ex1 = builtins.fromJSON string == { x = [ 1 2 3 ]; y = null; }; +} \ No newline at end of file