summary refs log tree commit diff
path: root/pkgs/lib/trivial.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/lib/trivial.nix')
-rw-r--r--pkgs/lib/trivial.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkgs/lib/trivial.nix b/pkgs/lib/trivial.nix
index aaae36afa058f..af47a8c88415e 100644
--- a/pkgs/lib/trivial.nix
+++ b/pkgs/lib/trivial.nix
@@ -18,4 +18,8 @@ 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;
+  
 }