From 95260715e6b40b94f00299f547147da86643ef37 Mon Sep 17 00:00:00 2001 From: NaiJi Date: Mon, 25 Apr 2022 02:04:41 +0000 Subject: [PATCH] Add '30.nix' --- 30.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 30.nix diff --git a/30.nix b/30.nix new file mode 100644 index 0000000..7816178 --- /dev/null +++ b/30.nix @@ -0,0 +1,10 @@ +with import { }; +let + listOfNumbers = [2 4 6 9 27]; + myMap = f: l: lib.fold (x: y: [(f x)] ++ y) [] l; +in +rec { + #your map should create the same result as the standard map function + example = map (x: builtins.div x 2) listOfNumbers; + result = myMap (x: builtins.div x 2) listOfNumbers; +} \ No newline at end of file