RIP lib.maybe

This commit is contained in:
tv 2015-10-20 02:36:13 +02:00
parent cb654782fa
commit aaa52a7a1c
2 changed files with 0 additions and 15 deletions

View File

@ -3,13 +3,8 @@
with builtins;
with lib;
let
maybe = import ./maybe.nix { inherit lib; };
in
builtins //
lib //
maybe //
rec {
eq = x: y: x == y;

View File

@ -1,10 +0,0 @@
{ ... }:
rec {
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);
}