mkdir nib/std && replace --all 'with' 'let ... in'

This commit is contained in:
Emile Clark-Boman 2025-12-14 20:47:34 +10:00
parent f9bb6ad937
commit fd008cd2e1
11 changed files with 108 additions and 104 deletions

View file

@ -1,6 +1,6 @@
{nib, ...}:
with builtins;
with nib.types; let
{nib, ...}: let
Res = nib.types.Res;
findFirst = nib.std.findFirst;
# TODO: try get enum generation working (and other type constructors)
# Maybe = mkEnum "nib::Maybe" {
# Some = mkEnumVariant {value = "nix::String";};
@ -66,7 +66,7 @@ in rec {
None = Maybe false null;
# Pattern Matching
isMaybe = T: attrNames T == ["_some_" "_value_"];
isMaybe = T: builtins.attrNames T == ["_some_" "_value_"];
isSome = T: isMaybe T && T._some_;
isNone = T: isMaybe T && !T._some_;