diff options
author | rekado <rekado@elephly.net> | 2014-10-30 20:22:54 +0100 |
---|---|---|
committer | rekado <rekado@elephly.net> | 2014-10-30 20:22:54 +0100 |
commit | 77cb84cd32cf8e4e7645c25bc580ceec7921eec5 (patch) | |
tree | 75f91e66f75f6e14f5606ef48f24984a92126785 /test.scm | |
parent | 55c479f841df1db6400802b7953de833b6fc038d (diff) |
Diffstat (limited to 'test.scm')
-rw-r--r-- | test.scm | 56 |
1 files changed, 28 insertions, 28 deletions
@@ -16,47 +16,47 @@ (begin (test "maybe 1" - '(with-monad: maybe-monad - (a <- (Just 5)) - (b <- (f 2)) - (c <- (Just 10)) - (return (+ a b c))) + '(with-monad maybe-monad + (a <- (Just 5)) + (b <- (f 2)) + (c <- (Just 10)) + (return (+ a b c))) (Just 17)) (test "maybe 2" - '(with-monad: maybe-monad - (a <- (Just 5)) - (b <- (f 0)) - (c <- (Just 10)) - (return (+ a b c))) + '(with-monad maybe-monad + (a <- (Just 5)) + (b <- (f 0)) + (c <- (Just 10)) + (return (+ a b c))) (Nothing)) (test "state 1" - '(run-state 0 (with-monad: state-monad - (put 10) - (put 9) - (modify (lambda (x) (+ 2 x))) - (modify (lambda (x) (+ 2 x))) - (get))) + '(run-state 0 (with-monad state-monad + (put 10) + (put 9) + (modify (lambda (x) (+ 2 x))) + (modify (lambda (x) (+ 2 x))) + (get))) 13) (test "state 2" - '(run-state 10 (with-monad: state-monad - (get))) + '(run-state 10 (with-monad state-monad + (get))) 10) (test "either 1" - '(with-monad: either-monad - (a <- (Right 5)) - (b <- (Right 0)) - (c <- (Right 10)) - (return (+ a b c))) + '(with-monad either-monad + (a <- (Right 5)) + (b <- (Right 0)) + (c <- (Right 10)) + (return (+ a b c))) (Right 15)) (test "either 2" - '(with-monad: either-monad - (a <- (Right 5)) - (b <- (Left "an error")) - (c <- (Right 10)) - (return (+ a b c))) + '(with-monad either-monad + (a <- (Right 5)) + (b <- (Left "an error")) + (c <- (Right 10)) + (return (+ a b c))) (Left "an error"))) |