summaryrefslogtreecommitdiff
path: root/test.scm
diff options
context:
space:
mode:
Diffstat (limited to 'test.scm')
-rw-r--r--test.scm56
1 files changed, 28 insertions, 28 deletions
diff --git a/test.scm b/test.scm
index c0e7297..02f5f0a 100644
--- a/test.scm
+++ b/test.scm
@@ -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")))