diff --git a/lib/trivial.nix b/lib/trivial.nix index ed59eff48473..8addde1b86cd 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -1,8 +1,3 @@ -with { - inherit (import ./lists.nix) deepSeqList; - inherit (import ./attrsets.nix) deepSeqAttrs; -}; - rec { # Identity function. @@ -23,23 +18,11 @@ rec { # Flip the order of the arguments of a binary function. flip = f: a: b: f b a; - # `seq x y' evaluates x, then returns y. That is, it forces strict - # evaluation of its first argument. - seq = x: y: if x == null then y else y; - - # Like `seq', but recurses into lists and attribute sets to force evaluation - # of all list elements/attributes. - deepSeq = x: y: - if builtins.isList x - then deepSeqList x y - else if builtins.isAttrs x - then deepSeqAttrs x y - else seq x y; - # Pull in some builtins not included elsewhere. inherit (builtins) pathExists readFile isBool isFunction - isInt add sub lessThan; + isInt add sub lessThan + seq deepSeq; # Return the Nixpkgs version number. nixpkgsVersion =