diff options
author | Eduardo Julian | 2017-01-06 19:38:11 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-01-06 19:38:11 -0400 |
commit | f9eca6ccaebfc916e2ccd347eb9bab7362b8899f (patch) | |
tree | 7ed65bcf51b8bc4961c3e9216e0bf8037c106e78 /stdlib/test | |
parent | 1e34eef43c24d1fb05afeccbe55e958b1b088dab (diff) |
- Gave custom tags to Error, instead of basing Error on Either.
Diffstat (limited to 'stdlib/test')
-rw-r--r-- | stdlib/test/test/lux/data/error.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/stdlib/test/test/lux/data/error.lux b/stdlib/test/test/lux/data/error.lux index 6127c37c1..880c2e0f1 100644 --- a/stdlib/test/test/lux/data/error.lux +++ b/stdlib/test/test/lux/data/error.lux @@ -16,22 +16,22 @@ (let [(^open "&/") &;Monad<Error>] ($_ seq (assert "Functor correctly handles both cases." - (and (|> (: (&;Error Int) (#;Right 10)) + (and (|> (: (&;Error Int) (#&;Success 10)) (&/map i.inc) - (case> (#;Right 11) true _ false)) + (case> (#&;Success 11) true _ false)) - (|> (: (&;Error Int) (#;Left "YOLO")) + (|> (: (&;Error Int) (#&;Error "YOLO")) (&/map i.inc) - (case> (#;Left "YOLO") true _ false)) + (case> (#&;Error "YOLO") true _ false)) )) (assert "Applicative correctly handles both cases." (and (|> (&/wrap 20) - (case> (#;Right 20) true _ false)) + (case> (#&;Success 20) true _ false)) (|> (&/apply (&/wrap i.inc) (&/wrap 10)) - (case> (#;Right 11) true _ false)) - (|> (&/apply (&/wrap i.inc) (#;Left "YOLO")) - (case> (#;Left "YOLO") true _ false)))) + (case> (#&;Success 11) true _ false)) + (|> (&/apply (&/wrap i.inc) (#&;Error "YOLO")) + (case> (#&;Error "YOLO") true _ false)))) (assert "Monad correctly handles both cases." (and (|> (do &;Monad<Error> @@ -39,13 +39,13 @@ a (wrap 10) b (wrap 20)] (wrap (f a b))) - (case> (#;Right 30) true _ false)) + (case> (#&;Success 30) true _ false)) (|> (do &;Monad<Error> [f (wrap i.+) - a (#;Left "YOLO") + a (#&;Error "YOLO") b (wrap 20)] (wrap (f a b))) - (case> (#;Left "YOLO") true _ false)) + (case> (#&;Error "YOLO") true _ false)) )) ))) @@ -57,5 +57,5 @@ [a (lift (io/wrap 123)) b (wrap 456)] (wrap (i.+ a b)))) - (case> (#;Right 579) true + (case> (#&;Success 579) true _ false))))) |