diff options
Diffstat (limited to 'stdlib/source/lux/type/check.lux')
-rw-r--r-- | stdlib/source/lux/type/check.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/source/lux/type/check.lux b/stdlib/source/lux/type/check.lux index 11b584859..b3ae0a04d 100644 --- a/stdlib/source/lux/type/check.lux +++ b/stdlib/source/lux/type/check.lux @@ -134,7 +134,7 @@ (function [context] (case (type;apply (list t-arg) t-func) #;None - (#R;Error ($_ text/append "Invalid type application: " (type;to-text t-func) " on " (type;to-text t-arg))) + (#R;Error ($_ text/compose "Invalid type application: " (type;to-text t-func) " on " (type;to-text t-arg))) (#;Some output) (#R;Success [context output])))) @@ -158,7 +158,7 @@ (#R;Success [context false]) #;None - (#R;Error ($_ text/append "Unknown type-var: " (nat/encode id)))))) + (#R;Error ($_ text/compose "Unknown type-var: " (nat/encode id)))))) (def: #export (read-var id) (-> Nat (Check Type)) @@ -168,24 +168,24 @@ (#R;Success [context type]) (#;Some #;None) - (#R;Error ($_ text/append "Unbound type-var: " (nat/encode id))) + (#R;Error ($_ text/compose "Unbound type-var: " (nat/encode id))) #;None - (#R;Error ($_ text/append "Unknown type-var: " (nat/encode id)))))) + (#R;Error ($_ text/compose "Unknown type-var: " (nat/encode id)))))) (def: #export (write-var id type) (-> Nat Type (Check Unit)) (function [context] (case (|> context (get@ #;var-bindings) (var::get id)) (#;Some (#;Some bound)) - (#R;Error ($_ text/append "Cannot rebind type-var: " (nat/encode id) " | Current type: " (type;to-text bound))) + (#R;Error ($_ text/compose "Cannot rebind type-var: " (nat/encode id) " | Current type: " (type;to-text bound))) (#;Some #;None) (#R;Success [(update@ #;var-bindings (var::put id (#;Some type)) context) []]) #;None - (#R;Error ($_ text/append "Unknown type-var: " (nat/encode id)))))) + (#R;Error ($_ text/compose "Unknown type-var: " (nat/encode id)))))) (def: (rewrite-var id type) (-> Nat Type (Check Unit)) @@ -196,7 +196,7 @@ []]) #;None - (#R;Error ($_ text/append "Unknown type-var: " (nat/encode id)))))) + (#R;Error ($_ text/compose "Unknown type-var: " (nat/encode id)))))) (def: #export (clear-var id) (-> Nat (Check Unit)) @@ -207,7 +207,7 @@ []]) #;None - (#R;Error ($_ text/append "Unknown type-var: " (nat/encode id)))))) + (#R;Error ($_ text/compose "Unknown type-var: " (nat/encode id)))))) (def: #export (clean t-id type) (-> Nat Type (Check Type)) @@ -329,7 +329,7 @@ (def: (fail-check expected actual) (All [a] (-> Type Type (Check a))) - (fail ($_ text/append + (fail ($_ text/compose "Expected: " (type;to-text expected) "\n\n" "Actual: " (type;to-text actual)))) @@ -488,11 +488,11 @@ (Check/wrap assumptions)) (fail-check expected actual)) - (^template [<unit> <append>] - [<unit> <unit>] + (^template [<identity> <compose>] + [<identity> <identity>] (Check/wrap assumptions) - [(<append> eL eR) (<append> aL aR)] + [(<compose> eL eR) (<compose> aL aR)] (do Monad<Check> [assumptions (check' eL aL assumptions)] (check' eR aR assumptions))) |