From e3858bb932f1b8384793a8660f1daf8a30bb976a Mon Sep 17 00:00:00 2001 From: Emile Clark-Boman Date: Sun, 25 Jan 2026 11:21:55 +1000 Subject: [PATCH] segregate types --- nt/primitives/{util => }/bootstrap.nix | 0 nt/primitives/types/default.nix | 8 ++++++++ nt/primitives/{util => types}/maybe.nix | 18 +++++++++--------- nt/primitives/{util => types}/null.nix | 10 +++++----- nt/primitives/{util => types}/wrap.nix | 12 ++++++------ 5 files changed, 28 insertions(+), 20 deletions(-) rename nt/primitives/{util => }/bootstrap.nix (100%) create mode 100644 nt/primitives/types/default.nix rename nt/primitives/{util => types}/maybe.nix (90%) rename nt/primitives/{util => types}/null.nix (87%) rename nt/primitives/{util => types}/wrap.nix (84%) diff --git a/nt/primitives/util/bootstrap.nix b/nt/primitives/bootstrap.nix similarity index 100% rename from nt/primitives/util/bootstrap.nix rename to nt/primitives/bootstrap.nix diff --git a/nt/primitives/types/default.nix b/nt/primitives/types/default.nix new file mode 100644 index 0000000..10f58e8 --- /dev/null +++ b/nt/primitives/types/default.nix @@ -0,0 +1,8 @@ +{mix, ...} @ inputs: +mix.newMixture inputs (mixture: { + includes.public = [ + ./maybe.nix + ./null.nix + ./wrap.nix + ]; +}) diff --git a/nt/primitives/util/maybe.nix b/nt/primitives/types/maybe.nix similarity index 90% rename from nt/primitives/util/maybe.nix rename to nt/primitives/types/maybe.nix index ab272a1..ebba469 100644 --- a/nt/primitives/util/maybe.nix +++ b/nt/primitives/types/maybe.nix @@ -1,13 +1,13 @@ {this, ...}: let - inherit - (this) - enfImpls - mkTrapdoorFn - mkTrapdoorSet - ntTrapdoorKey - ntDynamicTrapdoorKey - openTrapdoor - ; + # inherit + # (this) + # enfImpls + # mkTrapdoorFn + # mkTrapdoorSet + # ntTrapdoorKey + # ntDynamicTrapdoorKey + # openTrapdoor + # ; in { # NOTE: Maybe is used to simplify parsing Type/Class declarations # NOTE: and therefore must be implemented manually diff --git a/nt/primitives/util/null.nix b/nt/primitives/types/null.nix similarity index 87% rename from nt/primitives/util/null.nix rename to nt/primitives/types/null.nix index 26ec531..399c3d6 100644 --- a/nt/primitives/util/null.nix +++ b/nt/primitives/types/null.nix @@ -1,10 +1,10 @@ # XXX: TODO: replace Null with the naive Maybe type {this, ...}: let - inherit - (this) - ntTrapdoorKey - mkTrapdoorSet - ; + # inherit + # (this) + # ntTrapdoorKey + # mkTrapdoorSet + # ; in { # NOTE: This is not good for writing type safe code # NOTE: it is however efficient for bootstrapping the primitives diff --git a/nt/primitives/util/wrap.nix b/nt/primitives/types/wrap.nix similarity index 84% rename from nt/primitives/util/wrap.nix rename to nt/primitives/types/wrap.nix index 72aa5e4..55a218e 100644 --- a/nt/primitives/util/wrap.nix +++ b/nt/primitives/types/wrap.nix @@ -1,10 +1,10 @@ {this, ...}: let - inherit - (this) - ntTrapdoorKey - mkTrapdoorFn - mkTrapdoorSet - ; + # inherit + # (this) + # ntTrapdoorKey + # mkTrapdoorFn + # mkTrapdoorSet + # ; in { # NOTE: Wrap is used to simplify parsing Type/Class declarations # NOTE: and therefore must be implemented manually