diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux.lux | 42 |
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) |