summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-01-03 23:24:33 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-01-03 23:25:08 +0300
commit65ed5fb564d11a2f36bc5ce8e63daca48c9bc919 (patch)
tree4a04ac749a80a8537a51e2d7545693f7cdd023dd
parentf5bc1763ce762ef85ee85893242f83379e8a937b (diff)
downloadgcd-65ed5fb564d11a2f36bc5ce8e63daca48c9bc919.tar.gz
nix: updated for modern nix
-rw-r--r--gcd.nix5
1 files changed, 2 insertions, 3 deletions
diff --git a/gcd.nix b/gcd.nix
index 385793c..23a2d14 100644
--- a/gcd.nix
+++ b/gcd.nix
@@ -21,10 +21,9 @@ trace: gcd2: 11 <-> 0
list:
let
- inherit (builtins) div toString trace
- tail head;
+ inherit (builtins) trace tail head;
- rem = x: y: x - y*(div x y);
+ rem = x: y: x - y*(x / y);
gcd2 = x: y: trace "gcd2: ${toString x} <-> ${toString y}"
(if y == 0 then x else gcd2 y (rem x y));