From 2bbd01485a73b0b23da77efa46212d1f833b5efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edward=20Tj=C3=B6rnhammar?= Date: Tue, 16 Sep 2014 18:03:46 +0200 Subject: [PATCH] init list helper --- lib/lists.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/lists.nix b/lib/lists.nix index 4b5f04a67585..af70faacbcd7 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -209,6 +209,10 @@ in rec { assert list != []; elemAt list (dec (length list)); + # Return all elements but the last + init = list: assert list != []; take (length list - 1) list; + + # Zip two lists together. zipTwoLists = xs: ys: let