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 inherit
(this.util) (this.std)
filterAttrs filterAttrs
hasInfix hasInfix
mergeAttrsList mergeAttrsList
nameValuePair nameValuePair
projectOnto
removeSuffix removeSuffix
;
inherit
(this.parse)
projectOnto
;
inherit
(this.types)
Wrap Wrap
; ;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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