about summary refs log tree commit diff
path: root/yants-tests.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-08-08T22·32+0100
committerVincent Ambo <tazjin@google.com>2019-08-28T13·36+0100
commit5949663fcd843fe746f602f4a2509a11d8a94f06 (patch)
treef11213b9b86752c3eb2ec026062cb0adbf00b2a5 /yants-tests.nix
parent1da22249bd65ffeb6de1382d0a39da9240e63091 (diff)
feat: Implement support for typing functions
The defun helper takes a type signature and a function and makes a
typed version. Because we can.
Diffstat (limited to 'yants-tests.nix')
-rw-r--r--yants-tests.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/yants-tests.nix b/yants-tests.nix
index 8847758ced8a..e089aab4670a 100644
--- a/yants-tests.nix
+++ b/yants-tests.nix
@@ -45,4 +45,10 @@ deepSeq rec {
     blue = throw "It should not be blue!";
     green = throw "It should not be green!";
   };
+
+  # Test curried function definitions
+  func = defun [ string int string ]
+  (name: age: "${name} is ${toString age} years old");
+
+  testFunc = func "Brynhjulf" 42;
 } "All tests passed!\n"