diff options
Diffstat (limited to 'stdlib/source/lux/type/check.lux')
-rw-r--r-- | stdlib/source/lux/type/check.lux | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/lux/type/check.lux b/stdlib/source/lux/type/check.lux index 7d2e55982..fa6067ab6 100644 --- a/stdlib/source/lux/type/check.lux +++ b/stdlib/source/lux/type/check.lux @@ -58,8 +58,8 @@ (#error.Success [context' output]) (#error.Success [context' (f output)]) - (#error.Error error) - (#error.Error error))))) + (#error.Failure error) + (#error.Failure error))))) (structure: #export _ (Apply Check) (def: functor Functor<Check>) @@ -72,11 +72,11 @@ (#error.Success [context'' a]) (#error.Success [context'' (f a)]) - (#error.Error error) - (#error.Error error)) + (#error.Failure error) + (#error.Failure error)) - (#error.Error error) - (#error.Error error) + (#error.Failure error) + (#error.Failure error) ))) ) @@ -95,11 +95,11 @@ (#error.Success [context'' a]) (#error.Success [context'' a]) - (#error.Error error) - (#error.Error error)) + (#error.Failure error) + (#error.Failure error)) - (#error.Error error) - (#error.Error error) + (#error.Failure error) + (#error.Failure error) ))) ) @@ -155,8 +155,8 @@ (#error.Success [context' output]) (#error.Success output) - (#error.Error error) - (#error.Error error))) + (#error.Failure error) + (#error.Failure error))) (def: #export (throw exception message) (All [e a] (-> (ex.Exception e) e (Check a))) @@ -299,20 +299,20 @@ (#error.Success [context' output]) (#error.Success [context' (#.Some output)]) - (#error.Error _) + (#error.Failure _) (#error.Success [context #.None])))) (def: #export (fail message) (All [a] (-> Text (Check a))) (function (_ context) - (#error.Error message))) + (#error.Failure message))) (def: #export (assert message test) (-> Text Bit (Check Any)) (function (_ context) (if test (#error.Success [context []]) - (#error.Error message)))) + (#error.Failure message)))) (def: (either left right) (All [a] (-> (Check a) (Check a) (Check a))) @@ -321,7 +321,7 @@ (#error.Success [context' output]) (#error.Success [context' output]) - (#error.Error _) + (#error.Failure _) (right context)))) (def: (assumed? [e a] assumptions) @@ -441,18 +441,18 @@ (All [a] (-> (-> Any Text) (Check a) (Check a))) (function (_ context) (case (check context) - (#error.Error error) - (#error.Error (case error - "" - (on-error []) - - _ - ($_ text/compose - (on-error []) - text.new-line text.new-line - "-----------------------------------------" - text.new-line text.new-line - error))) + (#error.Failure error) + (#error.Failure (case error + "" + (on-error []) + + _ + ($_ text/compose + (on-error []) + text.new-line text.new-line + "-----------------------------------------" + text.new-line text.new-line + error))) output output))) @@ -628,7 +628,7 @@ {#.doc "A simple type-checking function that just returns a yes/no answer."} (-> Type Type Bit) (case (run fresh-context (check' (list) expected actual)) - (#error.Error _) + (#error.Failure _) #0 (#error.Success _) |