add prim/any.nix
This commit is contained in:
parent
3974b5afcd
commit
20fec532be
1 changed files with 11 additions and 0 deletions
11
nt/primitives/std/prim/any.nix
Normal file
11
nt/primitives/std/prim/any.nix
Normal 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}\"";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue