Add fail macro

This commit is contained in:
Correl Roush 2014-04-25 01:27:13 -04:00
parent 888effbf13
commit 7367dc2d05

View file

@ -12,6 +12,9 @@
(defmacro return (monad expr) (defmacro return (monad expr)
`(: ,monad return ,expr)) `(: ,monad return ,expr))
(defmacro fail (monad expr)
`(: ,monad fail ,expr))
(defmacro sequence (monad list) (defmacro sequence (monad list)
`(: lists foldr `(: lists foldr
(lambda (m acc) (mcons ,monad m acc)) (lambda (m acc) (mcons ,monad m acc))