From 663fe952f70f95a20deef64545f9dc469293a2aa Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Mon, 2 Dec 2024 16:02:27 +0100 Subject: [PATCH] Add qualified Nat and Int modules --- Stdlib/Data/Field.juvix | 2 +- Stdlib/Data/Int.juvix | 14 ++++++++------ Stdlib/Data/Nat.juvix | 17 ++++++++++------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Stdlib/Data/Field.juvix b/Stdlib/Data/Field.juvix index b11c5fae..ab73bbf9 100644 --- a/Stdlib/Data/Field.juvix +++ b/Stdlib/Data/Field.juvix @@ -1,7 +1,7 @@ module Stdlib.Data.Field; import Stdlib.Data.Field.Base open using {Field} public; -import Stdlib.Data.Field.Base as Field; +import Stdlib.Data.Field.Base as Field public; import Stdlib.Data.String.Base open; import Stdlib.Data.Nat; diff --git a/Stdlib/Data/Int.juvix b/Stdlib/Data/Int.juvix index cf62bf77..f634e777 100644 --- a/Stdlib/Data/Int.juvix +++ b/Stdlib/Data/Int.juvix @@ -1,8 +1,13 @@ module Stdlib.Data.Int; -import Stdlib.Data.Int.Base open hiding {+; -; *; div; mod} public; --- should be re-exported qualified -import Stdlib.Data.Int.Base as Int; +import Stdlib.Data.Int.Base open hiding {module Int; +; -; *; div; mod} public; + +module Int; + open Stdlib.Data.Int.Base.Int public; + + import Stdlib.Data.Int.Base open public; + import Stdlib.Data.Int.Ord open public; +end; import Stdlib.Data.String open; import Stdlib.Data.Bool open; @@ -15,9 +20,6 @@ import Stdlib.Trait.FromNatural open; import Stdlib.Trait.Integral open; import Stdlib.Trait.DivMod open; --- should be re-exported qualified -import Stdlib.Data.Int.Ord as Int; - --- Converts an ;Int; into ;String;. builtin int-to-string axiom intToString : Int -> String; diff --git a/Stdlib/Data/Nat.juvix b/Stdlib/Data/Nat.juvix index 81d45d07..17ea6af1 100644 --- a/Stdlib/Data/Nat.juvix +++ b/Stdlib/Data/Nat.juvix @@ -1,9 +1,15 @@ module Stdlib.Data.Nat; -import Juvix.Builtin.V1.Nat open public; -import Stdlib.Data.Nat.Base open hiding {+; *; div; mod} public; --- should be re-exported qualified -import Stdlib.Data.Nat.Base as Nat; +import Juvix.Builtin.V1.Nat open hiding {module Nat} public; +import Stdlib.Data.Nat.Base open hiding {module Nat; +; *; div; mod} public; + +module Nat; + open Stdlib.Data.Nat.Base.Nat public; + + import Stdlib.Data.Nat.Base open public; + import Stdlib.Data.Nat.Ord open public; +end; + import Stdlib.Data.String.Base open; import Stdlib.Trait.Eq open public; @@ -13,9 +19,6 @@ import Stdlib.Trait.Natural open public; import Stdlib.Trait.FromNatural open public; import Stdlib.Trait.DivMod open public; --- should be re-exported qualified -import Stdlib.Data.Nat.Ord as Nat; - --- Converts a ;Nat; into a ;String;. builtin nat-to-string axiom natToString : Nat -> String;