aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-03-17 22:19:33 -0400
committerEduardo Julian2019-03-17 22:19:33 -0400
commit0fcb373ed1cdc2750f02e5535d29569dd8ae5a5b (patch)
tree0e4c1b0bcb9b18a95a6bebc648ba8570e6dd3816 /stdlib/source/lux.lux
parent54b69afa96cd00b174b07c3f23b496b5e5b63858 (diff)
Minor improvements.
Diffstat (limited to 'stdlib/source/lux.lux')
-rw-r--r--stdlib/source/lux.lux42
1 files changed, 18 insertions, 24 deletions
diff --git a/stdlib/source/lux.lux b/stdlib/source/lux.lux
index 549d63112..323615249 100644
--- a/stdlib/source/lux.lux
+++ b/stdlib/source/lux.lux
@@ -5356,37 +5356,31 @@
(-> Type Code)
(case type
(#Primitive name params)
- (` (#Primitive (~ (text$ name)) (~ (untemplate-list (list;map type-to-code params)))))
+ (` (#.Primitive (~ (text$ name)) (~ (untemplate-list (list;map type-to-code params)))))
(^template [<tag>]
(<tag> left right)
(` (<tag> (~ (type-to-code left)) (~ (type-to-code right)))))
- ([#Sum] [#Product])
-
- (#Function in out)
- (` (#Function (~ (type-to-code in)) (~ (type-to-code out))))
-
- (#Parameter idx)
- (` (#Parameter (~ (nat$ idx))))
-
- (#Var id)
- (` (#Var (~ (nat$ id))))
+ ([#.Sum] [#.Product]
+ [#.Function]
+ [#.Apply])
- (#Ex id)
- (` (#Ex (~ (nat$ id))))
-
- (#UnivQ env type)
- (let [env' (untemplate-list (list;map type-to-code env))]
- (` (#UnivQ (~ env') (~ (type-to-code type)))))
+ (^template [<tag>]
+ (<tag> id)
+ (` (<tag> (~ (nat$ id)))))
+ ([#.Parameter] [#.Var] [#.Ex])
- (#ExQ env type)
- (let [env' (untemplate-list (list;map type-to-code env))]
- (` (#ExQ (~ env') (~ (type-to-code type)))))
+ (^template [<tag>]
+ (<tag> env type)
+ (let [env' (untemplate-list (list;map type-to-code env))]
+ (` (<tag> (~ env') (~ (type-to-code type))))))
+ ([#.UnivQ] [#.ExQ])
- (#Apply arg fun)
- (` (#Apply (~ (type-to-code arg)) (~ (type-to-code fun))))
-
- (#Named [module name] type)
+ (#Named [module name] anonymous)
+ ## TODO: Generate the explicit type definition instead of using
+ ## the "identifier$" shortcut below.
+ ## (` (#.Named [(~ (text$ module)) (~ (text$ name))]
+ ## (~ (type-to-code anonymous))))
(identifier$ [module name])))
(macro: #export (loop tokens)