aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/type/unit.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-07-27 03:51:10 -0400
committerEduardo Julian2021-07-27 03:51:10 -0400
commit061fd8a209bbcaffc2bfb850ac6046752a567d50 (patch)
tree8cd83ad7d0bc06ded7976eb5420467e485733ae8 /stdlib/source/library/lux/type/unit.lux
parente64b6d0114c26a455e19a416b5f02a4d19dd711f (diff)
Re-named wrap => in && unwrap => out.
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/type/unit.lux58
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/library/lux/type/unit.lux b/stdlib/source/library/lux/type/unit.lux
index ccdb34d46..790aa77ad 100644
--- a/stdlib/source/library/lux/type/unit.lux
+++ b/stdlib/source/library/lux/type/unit.lux
@@ -91,16 +91,16 @@
(do meta.monad
[@ meta.current_module_name
#let [g!type (code.local_identifier type_name)]]
- (wrap (list (` (type: (~+ (|export|.format export)) (~ g!type)
- (~ (|annotations|.format annotations))
- (primitive (~ (code.text (%.name [@ type_name]))))))
+ (in (list (` (type: (~+ (|export|.format export)) (~ g!type)
+ (~ (|annotations|.format annotations))
+ (primitive (~ (code.text (%.name [@ type_name]))))))
- (` (implementation: (~+ (|export|.format export)) (~ (code.local_identifier unit_name))
- (..Unit (~ g!type))
+ (` (implementation: (~+ (|export|.format export)) (~ (code.local_identifier unit_name))
+ (..Unit (~ g!type))
- (def: (~' in) (~! ..in))
- (def: (~' out) (~! ..out))))
- ))))
+ (def: (~' in) (~! ..in))
+ (def: (~' out) (~! ..out))))
+ ))))
(def: scale
(Parser Ratio)
@@ -111,7 +111,7 @@
denominator <code>.nat
_ (<>.assert (format "Denominator must be positive: " (%.nat denominator))
(n.> 0 denominator))]
- (wrap [numerator denominator]))))
+ (in [numerator denominator]))))
(syntax: #export (scale:
{export |export|.parser}
@@ -122,26 +122,26 @@
(do meta.monad
[@ meta.current_module_name
#let [g!scale (code.local_identifier type_name)]]
- (wrap (list (` (type: (~+ (|export|.format export)) ((~ g!scale) (~' u))
- (~ (|annotations|.format annotations))
- (primitive (~ (code.text (%.name [@ type_name]))) [(~' u)])))
-
- (` (implementation: (~+ (|export|.format export)) (~ (code.local_identifier scale_name))
- (..Scale (~ g!scale))
-
- (def: (~' scale)
- (|>> ((~! ..out))
- (i.* (~ (code.int (.int numerator))))
- (i./ (~ (code.int (.int denominator))))
- ((~! ..in))))
- (def: (~' de_scale)
- (|>> ((~! ..out))
- (i.* (~ (code.int (.int denominator))))
- (i./ (~ (code.int (.int numerator))))
- ((~! ..in))))
- (def: (~' ratio)
- [(~ (code.nat numerator)) (~ (code.nat denominator))])))
- ))))
+ (in (list (` (type: (~+ (|export|.format export)) ((~ g!scale) (~' u))
+ (~ (|annotations|.format annotations))
+ (primitive (~ (code.text (%.name [@ type_name]))) [(~' u)])))
+
+ (` (implementation: (~+ (|export|.format export)) (~ (code.local_identifier scale_name))
+ (..Scale (~ g!scale))
+
+ (def: (~' scale)
+ (|>> ((~! ..out))
+ (i.* (~ (code.int (.int numerator))))
+ (i./ (~ (code.int (.int denominator))))
+ ((~! ..in))))
+ (def: (~' de_scale)
+ (|>> ((~! ..out))
+ (i.* (~ (code.int (.int denominator))))
+ (i./ (~ (code.int (.int numerator))))
+ ((~! ..in))))
+ (def: (~' ratio)
+ [(~ (code.nat numerator)) (~ (code.nat denominator))])))
+ ))))
(def: #export (re_scale from to quantity)
(All [si so u] (-> (Scale si) (Scale so) (Qty (si u)) (Qty (so u))))