Introduce mapNullable into lib and use it in a few places

Also simply some configure flag logic my grep also alerted me too.
This commit is contained in:
John Ericson
2017-04-17 17:04:04 -04:00
parent f3055a3c50
commit 85aa5005af
7 changed files with 18 additions and 14 deletions
+3
View File
@@ -108,6 +108,9 @@ rec {
# Flip the order of the arguments of a binary function.
flip = f: a: b: f b a;
# Apply function if argument is non-null
mapNullable = f: a: if isNull a then a else f a;
# Pull in some builtins not included elsewhere.
inherit (builtins)
pathExists readFile isBool isFunction