diff options
Diffstat (limited to 'stdlib/source/lux/type/implicit.lux')
-rw-r--r-- | stdlib/source/lux/type/implicit.lux | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/stdlib/source/lux/type/implicit.lux b/stdlib/source/lux/type/implicit.lux index 1161a45b3..36d9b2e03 100644 --- a/stdlib/source/lux/type/implicit.lux +++ b/stdlib/source/lux/type/implicit.lux @@ -8,10 +8,10 @@ ["." product] ["." maybe] ["." number] - ["." text ("#;." equivalence) + ["." text ("#@." equivalence) format] [collection - ["." list ("#;." monad fold)] + ["." list ("#@." monad fold)] ["dict" dictionary (#+ Dictionary)]]] ["." macro ["." code] @@ -86,8 +86,8 @@ [this-module-name macro.current-module-name imp-mods (macro.imported-modules this-module-name) tag-lists (monad.map @ macro.tag-lists imp-mods) - #let [tag-lists (|> tag-lists list;join (list;map product.left) list;join) - candidates (list.filter (|>> product.right (text;= simple-name)) + #let [tag-lists (|> tag-lists list@join (list@map product.left) list@join) + candidates (list.filter (|>> product.right (text@= simple-name)) tag-lists)]] (case candidates #.Nil @@ -113,22 +113,22 @@ (-> Text (List [Text Definition]) (List [Name Type])) (|> definitions (list.filter (function (_ [name [def-type def-anns def-value]]) - (macro.struct? def-anns))) - (list;map (function (_ [name [def-type def-anns def-value]]) + (macro.structure? def-anns))) + (list@map (function (_ [name [def-type def-anns def-value]]) [[this-module-name name] def-type])))) (def: local-env (Meta (List [Name Type])) (do macro.monad [local-batches macro.locals - #let [total-locals (list;fold (function (_ [name type] table) - (dict.put~ name type table)) + #let [total-locals (list@fold (function (_ [name type] table) + (dict.try-put name type table)) (: (Dictionary Text Type) (dict.new text.hash)) - (list;join local-batches))]] + (list@join local-batches))]] (wrap (|> total-locals dict.entries - (list;map (function (_ [name type]) [["" name] type])))))) + (list@map (function (_ [name type]) [["" name] type])))))) (def: local-structs (Meta (List [Name Type])) @@ -147,7 +147,7 @@ [exports (macro.exports imp-mod)] (wrap (prepare-definitions imp-mod exports)))) imp-mods)] - (wrap (list;join export-batches)))) + (wrap (list@join export-batches)))) (def: (apply-function-type func arg) (-> Type Type (Check Type)) @@ -203,7 +203,7 @@ (do macro.monad [compiler macro.get-compiler] (case (|> alts - (list;map (function (_ [alt-name alt-type]) + (list@map (function (_ [alt-name alt-type]) (case (check.run context (do check.monad [[tvars alt-type] (concrete-type alt-type) @@ -217,7 +217,7 @@ (#.Right =deps) (list [alt-name =deps])))) - list;join) + list@join) #.Nil (macro.fail (format "No candidates for provisioning: " (%type dep))) @@ -252,7 +252,7 @@ [compiler macro.get-compiler context macro.type-context] (case (|> alts - (list;map (function (_ [alt-name alt-type]) + (list@map (function (_ [alt-name alt-type]) (case (check.run context (do check.monad [[tvars alt-type] (concrete-type alt-type) @@ -268,7 +268,7 @@ (#.Right =deps) (list [alt-name =deps])))) - list;join) + list@join) #.Nil (macro.fail (format "No alternatives for " (%type (type.function input-types output-type)))) @@ -303,7 +303,7 @@ (code.identifier constructor) _ - (` ((~ (code.identifier constructor)) (~+ (list;map instance$ dependencies)))))) + (` ((~ (code.identifier constructor)) (~+ (list@map instance$ dependencies)))))) (syntax: #export (::: {member s.identifier} @@ -346,19 +346,19 @@ (#.Cons chosen #.Nil) (wrap (list (` (:: (~ (instance$ chosen)) (~ (code.local-identifier (product.right member))) - (~+ (list;map code.identifier args)))))) + (~+ (list@map code.identifier args)))))) _ (macro.fail (format "Too many options available: " (|> chosen-ones - (list;map (|>> product.left %name)) + (list@map (|>> product.left %name)) (text.join-with ", ")) " --- for type: " (%type sig-type))))) (#.Right [args _]) (do @ [labels (|> (macro.gensym "") (list.repeat (list.size args)) (monad.seq @))] - (wrap (list (` (let [(~+ (|> (list.zip2 labels args) (list;map join-pair) list;join))] + (wrap (list (` (let [(~+ (|> (list.zip2 labels args) (list@map join-pair) list@join))] (..::: (~ (code.identifier member)) (~+ labels))))))) )) @@ -376,14 +376,14 @@ (do @ [g!implicit+ (implicit-bindings (list.size structures))] (wrap (list (` (let [(~+ (|> (list.zip2 g!implicit+ structures) - (list;map (function (_ [g!implicit structure]) + (list@map (function (_ [g!implicit structure]) (list g!implicit structure))) - list;join))] + list@join))] (~ body))))))) (syntax: #export (implicit: {structures ..implicits}) (do @ [g!implicit+ (implicit-bindings (list.size structures))] (wrap (|> (list.zip2 g!implicit+ structures) - (list;map (function (_ [g!implicit structure]) + (list@map (function (_ [g!implicit structure]) (` (def: (~ g!implicit) (~ structure))))))))) |