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;
|
||||
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue