mirror of
https://github.com/correl/calrissian.git
synced 2024-11-23 11:09:58 +00:00
Removed trailing whitespace.
This commit is contained in:
parent
572022bf98
commit
e23ab8f448
1 changed files with 5 additions and 5 deletions
|
@ -43,32 +43,32 @@
|
||||||
(f (lambda (n) (return ,monad (* 3 n)))))
|
(f (lambda (n) (return ,monad (* 3 n)))))
|
||||||
(is-equal-m ,monad (>>= ,monad (return ,monad a) f)
|
(is-equal-m ,monad (>>= ,monad (return ,monad a) f)
|
||||||
(funcall f a))))
|
(funcall f a))))
|
||||||
|
|
||||||
(deftest monad-right-identity
|
(deftest monad-right-identity
|
||||||
(let ((m (return ,monad 3)))
|
(let ((m (return ,monad 3)))
|
||||||
(is-equal-m ,monad (>>= ,monad m (lambda (m') (return ,monad m')))
|
(is-equal-m ,monad (>>= ,monad m (lambda (m') (return ,monad m')))
|
||||||
m)))
|
m)))
|
||||||
|
|
||||||
(deftest monad-associativity
|
(deftest monad-associativity
|
||||||
(let ((m (return ,monad 3))
|
(let ((m (return ,monad 3))
|
||||||
(f (lambda (n) (return ,monad (* 3 n))))
|
(f (lambda (n) (return ,monad (* 3 n))))
|
||||||
(g (lambda (n) (return ,monad (+ 5 n)))))
|
(g (lambda (n) (return ,monad (+ 5 n)))))
|
||||||
(is-equal-m ,monad (>>= ,monad (>>= ,monad m f) g)
|
(is-equal-m ,monad (>>= ,monad (>>= ,monad m f) g)
|
||||||
(>>= ,monad m (lambda (x) (>>= ,monad (funcall f x) g))))))
|
(>>= ,monad m (lambda (x) (>>= ,monad (funcall f x) g))))))
|
||||||
|
|
||||||
(deftest monad-do-left-identity
|
(deftest monad-do-left-identity
|
||||||
(let ((a 3)
|
(let ((a 3)
|
||||||
(f (lambda (n) (return ,monad (* 3 n)))))
|
(f (lambda (n) (return ,monad (* 3 n)))))
|
||||||
(is-equal-m ,monad (do-m ,monad (a' <- (return ,monad a))
|
(is-equal-m ,monad (do-m ,monad (a' <- (return ,monad a))
|
||||||
(funcall f a'))
|
(funcall f a'))
|
||||||
(do-m ,monad (funcall f a)))))
|
(do-m ,monad (funcall f a)))))
|
||||||
|
|
||||||
(deftest monad-do-right-identity
|
(deftest monad-do-right-identity
|
||||||
(let ((m (return ,monad 3)))
|
(let ((m (return ,monad 3)))
|
||||||
(is-equal-m ,monad (do-m ,monad (x <- m)
|
(is-equal-m ,monad (do-m ,monad (x <- m)
|
||||||
(return ,monad x))
|
(return ,monad x))
|
||||||
(do-m ,monad m))))
|
(do-m ,monad m))))
|
||||||
|
|
||||||
(deftest monad-do-associativity
|
(deftest monad-do-associativity
|
||||||
(let ((m (return ,monad 3))
|
(let ((m (return ,monad 3))
|
||||||
(f (lambda (n) (return ,monad (* 3 n))))
|
(f (lambda (n) (return ,monad (* 3 n))))
|
||||||
|
|
Loading…
Reference in a new issue