add prim/any.nix

This commit is contained in:
Emile Clark-Boman 2026-01-28 13:51:42 +10:00
parent 3974b5afcd
commit 20fec532be

View file

@ -0,0 +1,11 @@
{...}: let
inherit
(builtins)
typeOf
;
in {
enfIsPrimitive = type: value: msg: let
got = typeOf value;
in
got == type || throw "${msg}: expected primitive nix type \"${type}\" but got \"${got}\"";
}