From 5949663fcd843fe746f602f4a2509a11d8a94f06 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 8 Aug 2019 23:32:43 +0100 Subject: feat: Implement support for typing functions The defun helper takes a type signature and a function and makes a typed version. Because we can. --- yants-tests.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'yants-tests.nix') diff --git a/yants-tests.nix b/yants-tests.nix index 8847758ced..e089aab467 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" -- cgit 1.4.1