diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/macro/poly.lux | 30 | ||||
-rw-r--r-- | stdlib/source/lux/macro/poly/eq.lux | 4 | ||||
-rw-r--r-- | stdlib/source/lux/macro/poly/functor.lux | 2 | ||||
-rw-r--r-- | stdlib/source/lux/macro/poly/json.lux | 4 |
4 files changed, 20 insertions, 20 deletions
diff --git a/stdlib/source/lux/macro/poly.lux b/stdlib/source/lux/macro/poly.lux index 0cf927f00..b1e1a3d1b 100644 --- a/stdlib/source/lux/macro/poly.lux +++ b/stdlib/source/lux/macro/poly.lux @@ -45,7 +45,7 @@ (#R;Error (|> remaining (L/map type;to-text) (text;join-with ", ") - (text/append "Unconsumed types: ")))))) + (text/compose "Unconsumed types: ")))))) (def: #export (run type poly) (All [a] (-> Type (Poly a) (R;Result a))) @@ -98,7 +98,7 @@ (def: (label idx) (-> Nat Code) - (code;local-symbol (text/append "label\u0000" (nat/encode idx)))) + (code;local-symbol (text/compose "label\u0000" (nat/encode idx)))) (def: #export (with-extension type poly) (All [a] (-> Type (Poly a) (Poly [Code a]))) @@ -124,7 +124,7 @@ (wrap []) _ - (p;fail ($_ text/append "Not " <name> " type: " (type;to-text headT))))))] + (p;fail ($_ text/compose "Not " <name> " type: " (type;to-text headT))))))] [void "Void" #;Void] [unit "Unit" #;Unit] @@ -163,7 +163,7 @@ (let [members (<flattener> (type;un-name headT))] (if (n.> +1 (list;size members)) (local members poly) - (p;fail ($_ text/append "Not a " (Ident/encode (ident-for <tag>)) " type: " (type;to-text headT)))))))] + (p;fail ($_ text/compose "Not a " (Ident/encode (ident-for <tag>)) " type: " (type;to-text headT)))))))] [variant type;flatten-variant #;Sum] [tuple type;flatten-tuple #;Product] @@ -175,7 +175,7 @@ [headT any #let [[num-arg bodyT] (type;flatten-univ-q (type;un-name headT))]] (if (n.= +0 num-arg) - (p;fail ($_ text/append "Non-polymorphic type: " (type;to-text headT))) + (p;fail ($_ text/compose "Non-polymorphic type: " (type;to-text headT))) (wrap [num-arg bodyT])))) (def: #export (polymorphic poly) @@ -223,7 +223,7 @@ (if (n.> +0 (list;size inputsT)) (p;seq (local inputsT in-poly) (local (list outputT) out-poly)) - (p;fail ($_ text/append "Non-function type: " (type;to-text headT)))))) + (p;fail ($_ text/compose "Non-function type: " (type;to-text headT)))))) (def: #export (apply poly) (All [a] (-> (Poly a) (Poly a))) @@ -231,7 +231,7 @@ [headT any #let [[funcT paramsT] (type;flatten-application (type;un-name headT))]] (if (n.= +0 (list;size paramsT)) - (p;fail ($_ text/append "Non-application type: " (type;to-text headT))) + (p;fail ($_ text/compose "Non-application type: " (type;to-text headT))) (local (#;Cons funcT paramsT) poly)))) (def: #export (this expected) @@ -240,7 +240,7 @@ [actual any] (if (check;checks? expected actual) (wrap []) - (p;fail ($_ text/append + (p;fail ($_ text/compose "Types do not match." "\n" "Expected: " (type;to-text expected) "\n" " Actual: " (type;to-text actual)))))) @@ -264,10 +264,10 @@ (wrap poly-ast) #;None - (p;fail ($_ text/append "Unknown bound type: " (type;to-text headT)))) + (p;fail ($_ text/compose "Unknown bound type: " (type;to-text headT)))) _ - (p;fail ($_ text/append "Not a bound type: " (type;to-text headT)))))) + (p;fail ($_ text/compose "Not a bound type: " (type;to-text headT)))))) (def: #export (var id) (-> Nat (Poly Unit)) @@ -278,12 +278,12 @@ (#;Bound idx) (if (n.= id (adjusted-idx env idx)) (wrap []) - (p;fail ($_ text/append "Wrong bound type.\n" + (p;fail ($_ text/compose "Wrong bound type.\n" "Expected: " (nat/encode id) "\n" " Actual: " (nat/encode idx)))) _ - (p;fail ($_ text/append "Not a bound type: " (type;to-text headT)))))) + (p;fail ($_ text/compose "Not a bound type: " (type;to-text headT)))))) (def: #export (recursive poly) (All [a] (-> (Poly a) (Poly [Code a]))) @@ -299,7 +299,7 @@ (wrap [recT output])) _ - (p;fail ($_ text/append "Not a recursive type: " (type;to-text headT)))))) + (p;fail ($_ text/compose "Not a recursive type: " (type;to-text headT)))))) (def: #export recursive-self (Poly Code) @@ -313,7 +313,7 @@ (wrap self-call) _ - (p;fail ($_ text/append "Not a recursive type: " (type;to-text headT)))))) + (p;fail ($_ text/compose "Not a recursive type: " (type;to-text headT)))))) (def: #export recursive-call (Poly Code) @@ -331,7 +331,7 @@ (All [a] (Poly a)) (do p;Monad<Parser> [current any - #let [_ (log! ($_ text/append + #let [_ (log! ($_ text/compose "{" (Ident/encode (ident-for ;;log)) "} " (type;to-text current)))]] (p;fail "LOGGING"))) diff --git a/stdlib/source/lux/macro/poly/eq.lux b/stdlib/source/lux/macro/poly/eq.lux index d5b331642..d8da515f4 100644 --- a/stdlib/source/lux/macro/poly/eq.lux +++ b/stdlib/source/lux/macro/poly/eq.lux @@ -117,8 +117,8 @@ (do @ [g!eqs (poly;tuple (p;many Eq<?>)) #let [indices (|> (list;size g!eqs) n.dec (list;n.range +0)) - g!lefts (L/map (|>. nat/encode (text/append "left") code;local-symbol) indices) - g!rights (L/map (|>. nat/encode (text/append "right") code;local-symbol) indices)]] + g!lefts (L/map (|>. nat/encode (text/compose "left") code;local-symbol) indices) + g!rights (L/map (|>. nat/encode (text/compose "right") code;local-symbol) indices)]] (wrap (` (: (~ (@Eq inputT)) (function [[(~@ g!lefts)] [(~@ g!rights)]] (and (~@ (|> (list;zip3 g!eqs g!lefts g!rights) diff --git a/stdlib/source/lux/macro/poly/functor.lux b/stdlib/source/lux/macro/poly/functor.lux index cc6007220..139cc5f7e 100644 --- a/stdlib/source/lux/macro/poly/functor.lux +++ b/stdlib/source/lux/macro/poly/functor.lux @@ -60,7 +60,7 @@ [_ (wrap []) memberC (Arg<?> slotC)] (recur (n.inc idx) - (L/append pairsCC (list [slotC memberC]))))) + (L/compose pairsCC (list [slotC memberC]))))) (wrap pairsCC)))))] (wrap (` (case (~ valueC) [(~@ (L/map product;left pairsCC))] diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 321a80492..1e61d49f9 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -189,7 +189,7 @@ poly;bound poly;recursive-call ## If all else fails... - (p;fail (text/append "Cannot create JSON encoder for: " (type;to-text inputT))) + (p;fail (text/compose "Cannot create JSON encoder for: " (type;to-text inputT))) )))) (poly: #hidden Codec<JSON,?>//decode @@ -283,7 +283,7 @@ poly;bound poly;recursive-call ## If all else fails... - (p;fail (text/append "Cannot create JSON decoder for: " (type;to-text inputT))) + (p;fail (text/compose "Cannot create JSON decoder for: " (type;to-text inputT))) )))) (syntax: #export (Codec<JSON,?> inputT) |