While (p x) is false, replace x by the value returned by the
monadic computation (f x). Return (m-result x) for the first
x for which (p x) is true.
(defmonadfn m-until
"While (p x) is false, replace x by the value returned by the
monadic computation (f x). Return (m-result x) for the first
x for which (p x) is true."
[p f x]
(if (p x)
(m-result x)
(domonad
[y (f x)
z (m-until p f y)]
z)))
Comments top
No comments for m-until. Log in to add a comment.