From e2c7e38934772744883494a01a784acc15ad2ff7 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 27 Jun 2020 21:45:20 +0200 Subject: feat(nix/yants): add unit type Has one less value than bool. Change-Id: I2f2db07b1eb1f49172942bc1d8c6ceb30d987d84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/661 Reviewed-by: tazjin --- nix/yants/default.nix | 1 + nix/yants/tests/default.nix | 1 + 2 files changed, 2 insertions(+) (limited to 'nix') diff --git a/nix/yants/default.nix b/nix/yants/default.nix index aacc156b433b..6da99fa3c8c4 100644 --- a/nix/yants/default.nix +++ b/nix/yants/default.nix @@ -93,6 +93,7 @@ with builtins; let in lib.fix (self: { # Primitive types any = typedef "any" (_: true); + unit = typedef "unit" (v: v == {}); int = typedef "int" isInt; bool = typedef "bool" isBool; float = typedef "float" isFloat; diff --git a/nix/yants/tests/default.nix b/nix/yants/tests/default.nix index b006f8b832d0..da539ca3562b 100644 --- a/nix/yants/tests/default.nix +++ b/nix/yants/tests/default.nix @@ -9,6 +9,7 @@ with depot.nix.yants; deepSeq rec { # Test that all primitive types match primitives = [ + (unit {}) (int 15) (bool false) (float 13.37) -- cgit 1.4.1