RIP lib.maybe
This commit is contained in:
parent
cb654782fa
commit
aaa52a7a1c
@ -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;
|
||||
|
@ -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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user