add not fn

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

View file

@ -1,4 +1,9 @@
{...}: {
{...}: let
inherit
(builtins)
isFunction
;
in rec {
id = x: x;
# syntactic sugar for curry flipping
@ -15,4 +20,10 @@
if x != null
then f x
else x;
not = f:
if isFunction f
then x: not (f x)
# WARNING: assume isBool holds (or fail)
else ! f;
}