diff options
Diffstat (limited to 'stdlib/source/lux/type/implicit.lux')
-rw-r--r-- | stdlib/source/lux/type/implicit.lux | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux index 55583e45f..1e55c2ab1 100644 --- a/stdlib/source/lux/type/implicit.lux +++ b/stdlib/source/lux/type/implicit.lux @@ -114,19 +114,14 @@ (wrap [idx sig-type]))) (def: (prepare-definitions source-module target-module constants) - (-> Text Text (List [Text Global]) (List [Name Type])) + (-> Text Text (List [Text Definition]) (List [Name Type])) (do list.monad - [[name constant] constants] - (case constant - (#.Left _) - (list) - - (#.Right [exported? def-type def-anns def-value]) - (if (and (macro.structure? def-anns) - (or (text@= target-module source-module) - exported?)) - (list [[source-module name] def-type]) - (list))))) + [[name [exported? def-type def-anns def-value]] constants] + (if (and (macro.structure? def-anns) + (or (text@= target-module source-module) + exported?)) + (list [[source-module name] def-type]) + (list)))) (def: local-env (Meta (List [Name Type])) @@ -144,9 +139,9 @@ (def: local-structs (Meta (List [Name Type])) (do macro.monad - [this-module-name macro.current-module-name - definitions (macro.definitions this-module-name)] - (wrap (prepare-definitions this-module-name this-module-name definitions)))) + [this-module-name macro.current-module-name] + (:: @ map (prepare-definitions this-module-name this-module-name) + (macro.definitions this-module-name)))) (def: import-structs (Meta (List [Name Type])) @@ -154,9 +149,8 @@ [this-module-name macro.current-module-name imp-mods (macro.imported-modules this-module-name) export-batches (monad.map @ (function (_ imp-mod) - (do @ - [exports (macro.definitions imp-mod)] - (wrap (prepare-definitions imp-mod this-module-name exports)))) + (:: @ map (prepare-definitions imp-mod this-module-name) + (macro.definitions imp-mod))) imp-mods)] (wrap (list@join export-batches)))) |