aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/meta/type.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/library/lux/meta/type.lux')
-rw-r--r--stdlib/source/library/lux/meta/type.lux54
1 files changed, 27 insertions, 27 deletions
diff --git a/stdlib/source/library/lux/meta/type.lux b/stdlib/source/library/lux/meta/type.lux
index b2c4173a8..af6ee1351 100644
--- a/stdlib/source/library/lux/meta/type.lux
+++ b/stdlib/source/library/lux/meta/type.lux
@@ -250,18 +250,18 @@
(-> Type Code)
(case type
{.#Primitive name params}
- (` {.#Primitive (~ (code.text name))
- (.list (~+ (list#each code params)))})
+ (` {.#Primitive (, (code.text name))
+ (.list (,* (list#each code params)))})
(^.with_template [<tag>]
[{<tag> idx}
- (` {<tag> (~ (code.nat idx))})])
+ (` {<tag> (, (code.nat idx))})])
([.#Var] [.#Ex] [.#Parameter])
(^.with_template [<tag>]
[{<tag> left right}
- (` {<tag> (~ (code left))
- (~ (code right))})])
+ (` {<tag> (, (code left))
+ (, (code right))})])
([.#Sum] [.#Product] [.#Function] [.#Apply])
{.#Named name sub_type}
@@ -269,8 +269,8 @@
(^.with_template [<tag>]
[{<tag> env body}
- (` {<tag> (.list (~+ (list#each code env)))
- (~ (code body))})])
+ (` {<tag> (.list (,* (list#each code env)))
+ (, (code body))})])
([.#UnivQ] [.#ExQ])
))
@@ -387,7 +387,7 @@
(in (list g!_secret_marker_)))))
(def secret_marker
- (`` (symbol (~~ (new_secret_marker)))))
+ (`` (symbol (,, (new_secret_marker)))))
(def .public log!
(syntax (_ [input (<>.or (<>.and <code>.symbol
@@ -413,8 +413,8 @@
{.#Right valueC}
(macro.with_symbols [g!value]
- (in (list (` (.let [(~ g!value) (~ valueC)]
- (..log! (~ valueC) (~ (code.symbol ..secret_marker)) (~ g!value))))))))))
+ (in (list (` (.let [(, g!value) (, valueC)]
+ (..log! (, valueC) (, (code.symbol ..secret_marker)) (, g!value))))))))))
(def type_parameters
(Parser (List Text))
@@ -426,15 +426,15 @@
output <code>.any
value (<>.maybe <code>.any)])
(macro.with_symbols [g!_]
- (.let [casterC (` (is (All ((~ g!_) (~+ (list#each code.local type_vars)))
- (-> (~ input) (~ output)))
+ (.let [casterC (` (is (All ((, g!_) (,* (list#each code.local type_vars)))
+ (-> (, input) (, output)))
(|>> as_expected)))]
(case value
{.#None}
(in (list casterC))
{.#Some value}
- (in (list (` ((~ casterC) (~ value))))))))))
+ (in (list (` ((, casterC) (, value))))))))))
(type Typed
(Record
@@ -457,22 +457,22 @@
exemplar (..typed lux)
computation (..typed lux)])
(macro.with_symbols [g!_]
- (.let [typeC (` (All ((~ g!_) (~+ (list#each code.local type_vars)))
- (-> (~ (the #type exemplar))
- (~ (the #type computation)))))
- shareC (` (is (~ typeC)
- (.function ((~ g!_) (~ g!_))
- (~ (the #expression computation)))))]
- (in (list (` ((~ shareC) (~ (the #expression exemplar))))))))))
+ (.let [typeC (` (All ((, g!_) (,* (list#each code.local type_vars)))
+ (-> (, (the #type exemplar))
+ (, (the #type computation)))))
+ shareC (` (is (, typeC)
+ (.function ((, g!_) (, g!_))
+ (, (the #expression computation)))))]
+ (in (list (` ((, shareC) (, (the #expression exemplar))))))))))
(def .public by_example
(syntax (_ lux [type_vars ..type_parameters
exemplar (..typed lux)
extraction <code>.any])
- (in (list (` (.type_of ((~! ..sharing) [(~+ (list#each code.local type_vars))]
- (is (~ (the #type exemplar))
- (~ (the #expression exemplar)))
- (is (~ extraction)
+ (in (list (` (.type_of ((,! ..sharing) [(,* (list#each code.local type_vars))]
+ (is (, (the #type exemplar))
+ (, (the #expression exemplar)))
+ (is (, extraction)
... The value of this expression will never be relevant, so it doesn't matter what it is.
(.as .Nothing [])))))))))
@@ -508,8 +508,8 @@
(def .public let
(syntax (_ [bindings (<code>.tuple (<>.some (<>.and <code>.any <code>.any)))
bodyT <code>.any])
- (in (list (` (..with_expansions [(~+ (|> bindings
+ (in (list (` (..with_expansions [(,* (|> bindings
(list#each (.function (_ [localT valueT])
- (list localT (` (.these (~ valueT))))))
+ (list localT (` (.these (, valueT))))))
list#conjoint))]
- (~ bodyT)))))))
+ (, bodyT)))))))