cascade-functions/coalesce.nix

8 lines
127 B
Nix
Raw Normal View History

2022-10-17 15:41:57 +00:00
with builtins;
let fn = y: vs:
if vs == [] then null else
if head vs != null then head vs else
y y (tail vs);
in
fn fn