diff --git a/include/monad-tests.lfe b/include/monad-tests.lfe index 7630bba..5695954 100644 --- a/include/monad-tests.lfe +++ b/include/monad-tests.lfe @@ -43,32 +43,32 @@ (f (lambda (n) (return ,monad (* 3 n))))) (is-equal-m ,monad (>>= ,monad (return ,monad a) f) (funcall f a)))) - + (deftest monad-right-identity (let ((m (return ,monad 3))) (is-equal-m ,monad (>>= ,monad m (lambda (m') (return ,monad m'))) m))) - + (deftest monad-associativity (let ((m (return ,monad 3)) (f (lambda (n) (return ,monad (* 3 n)))) (g (lambda (n) (return ,monad (+ 5 n))))) (is-equal-m ,monad (>>= ,monad (>>= ,monad m f) g) (>>= ,monad m (lambda (x) (>>= ,monad (funcall f x) g)))))) - + (deftest monad-do-left-identity (let ((a 3) (f (lambda (n) (return ,monad (* 3 n))))) (is-equal-m ,monad (do-m ,monad (a' <- (return ,monad a)) (funcall f a')) (do-m ,monad (funcall f a))))) - + (deftest monad-do-right-identity (let ((m (return ,monad 3))) (is-equal-m ,monad (do-m ,monad (x <- m) (return ,monad x)) (do-m ,monad m)))) - + (deftest monad-do-associativity (let ((m (return ,monad 3)) (f (lambda (n) (return ,monad (* 3 n))))