From d7f0c3d171eec868a8c13bed2e076c65cbfbaabe Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 17 Oct 2015 07:35:21 +0200 Subject: move maybe to krebs lib --- default.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index fd127084..841882f5 100644 --- a/default.nix +++ b/default.nix @@ -7,6 +7,8 @@ assert current-user-name != ""; let lib = import ; + klib = import ./krebs/4lib { inherit lib; }; +in with klib; let nspath = ns: p: ./. + "/${ns}/${p}"; kpath = nspath "krebs"; @@ -67,12 +69,4 @@ let }.${v} or Nothing) (builtins.readDir path))); - # TODO move to lib - Just = x: { type = "maybe"; value = x; }; - Nothing = { type = "maybe"; }; - isMaybe = x: builtins.typeOf x == "set" && x.type or false == "maybe"; - isJust = x: isMaybe x && builtins.hasAttr "value" x; - fromJust = x: assert isJust x; x.value; - catMaybes = xs: map fromJust (builtins.filter isJust xs); - in out -- cgit v1.2.3