Merge pull request #24974 from Ericson2314/mapNullable

Introduce `mapNullable` into lib and use it in a few places
This commit is contained in:
John Ericson
2017-04-17 17:12:14 -04:00
committed by GitHub
7 changed files with 18 additions and 14 deletions

View File

@@ -122,6 +122,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