update inherit paths

This commit is contained in:
Emile Clark-Boman 2026-01-27 08:35:55 +10:00
parent 1c807428ad
commit e5c8479a8f
10 changed files with 88 additions and 37 deletions

View file

@ -9,13 +9,21 @@
;
inherit
(this.util)
(this.std)
filterAttrs
hasInfix
mergeAttrsList
nameValuePair
projectOnto
removeSuffix
;
inherit
(this.parse)
projectOnto
;
inherit
(this.types)
Wrap
;

View file

@ -29,10 +29,12 @@ let
delegate;
this = bootstrap {inherit this bootstrap;} [
./nt.nix
{
std = ./std/bootstrap.nix;
types = ./types/bootstrap.nix;
parse = ./parse/bootstrap.nix;
trapdoor = ./trapdoor.nix;
}
];
in

View file

@ -10,7 +10,7 @@
;
inherit
(this)
(this.trapdoor)
mkTrapdoorKey
openTrapdoor
;

View file

@ -16,6 +16,11 @@
(this.std)
enfIsAttrs
;
inherit
(this.types)
Wrap
;
in rec {
# form: getAttrAt :: list string -> set -> null | Wrap Any
# given path as a list of strings, return that value of an

View file

@ -1,4 +1,4 @@
{...}: let
{this, ...}: let
inherit
(builtins)
attrNames
@ -14,6 +14,12 @@
tail
typeOf
;
inherit
(this)
flipCurry
id
;
in rec {
enfIsAttrs = value: msg: let
got = typeOf value;

View file

@ -1,11 +1,14 @@
# WARNING: /nt/primitives/bootstrap cannot depend on mix
# WARNING: this file is strictly for bootstrapping nt
{bootstrap, ...} @ inputs:
bootstrap inputs [
{bootstrap, ...}: let
# WARNING: do not propagate `this` from parent, bootstrap/std must
# WARNING: remain entirely independent from bootstrap
this = bootstrap {inherit this bootstrap;} [
./attrs.nix
./enforce.nix
./fn.nix
./list.nix
./num.nix
./string.nix
]
];
in
this

View file

@ -1,13 +1,21 @@
{this, ...}: let
# inherit
# (this)
# enfImpls
# mkTrapdoorFn
# mkTrapdoorSet
# ntTrapdoorKey
# ntDynamicTrapdoorKey
# openTrapdoor
# ;
inherit
(this)
ntTrapdoorKey
ntDynamicTrapdoorKey
;
inherit
(this.std)
enfImpls
;
inherit
(this.trapdoor)
mkTrapdoorFn
mkTrapdoorSet
openTrapdoor
;
in {
# NOTE: Maybe is used to simplify parsing Type/Class declarations
# NOTE: and therefore must be implemented manually

View file

@ -1,10 +1,13 @@
# XXX: TODO: replace Null with the naive Maybe type
{this, ...}: let
# inherit
# (this)
# ntTrapdoorKey
# mkTrapdoorSet
# ;
inherit
(this)
ntTrapdoorKey
;
inherit
(this.trapdoor)
mkTrapdoorSet
;
in {
# NOTE: This is not good for writing type safe code
# NOTE: it is however efficient for bootstrapping the primitives

View file

@ -1,10 +1,14 @@
{this, ...}: let
# inherit
# (this)
# ntTrapdoorKey
# mkTrapdoorFn
# mkTrapdoorSet
# ;
inherit
(this)
ntTrapdoorKey
;
inherit
(this.trapdoor)
mkTrapdoorFn
mkTrapdoorSet
;
in {
# NOTE: Wrap is used to simplify parsing Type/Class declarations
# NOTE: and therefore must be implemented manually

View file

@ -8,17 +8,29 @@
;
inherit
(this.util)
(this)
enfIsType
enfIsClassSig
typeSig
;
inherit
(this.std)
flipCurry
removeAttrsRec
;
inherit
(this.parse)
enfIsClassSig
hasAttrAt
mkTrapdoorSet
ntTrapdoorKey
parseClassSig
projectOnto
removeAttrsRec
typeSig
;
inherit
(this.types)
Wrap
;