add not fn
This commit is contained in:
parent
20fec532be
commit
2cabb50a38
1 changed files with 12 additions and 1 deletions
|
|
@ -1,4 +1,9 @@
|
||||||
{...}: {
|
{...}: let
|
||||||
|
inherit
|
||||||
|
(builtins)
|
||||||
|
isFunction
|
||||||
|
;
|
||||||
|
in rec {
|
||||||
id = x: x;
|
id = x: x;
|
||||||
|
|
||||||
# syntactic sugar for curry flipping
|
# syntactic sugar for curry flipping
|
||||||
|
|
@ -15,4 +20,10 @@
|
||||||
if x != null
|
if x != null
|
||||||
then f x
|
then f x
|
||||||
else x;
|
else x;
|
||||||
|
|
||||||
|
not = f:
|
||||||
|
if isFunction f
|
||||||
|
then x: not (f x)
|
||||||
|
# WARNING: assume isBool holds (or fail)
|
||||||
|
else ! f;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue