mirror of
https://github.com/correl/calrissian.git
synced 2024-11-23 19:19:57 +00:00
Add fail macro
This commit is contained in:
parent
888effbf13
commit
7367dc2d05
1 changed files with 3 additions and 0 deletions
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue