diff options
author | Adam Chlipala <adam@chlipala.net> | 2017-02-01 09:24:17 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2017-02-01 09:24:17 -0500 |
commit | 59454c9766685b381603aaf116bb43a9515dbdba (patch) | |
tree | 47b836f3e04babac7337e53c80ec972a3f0ea5c0 /lib/ur/option.ur | |
parent | 41cd154483d45c5d2fb0abf392b9bdc63d42b94e (diff) |
Option.app
Diffstat (limited to 'lib/ur/option.ur')
-rw-r--r-- | lib/ur/option.ur | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ur/option.ur b/lib/ur/option.ur index 05c50d1f..baa08466 100644 --- a/lib/ur/option.ur +++ b/lib/ur/option.ur @@ -40,6 +40,11 @@ fun mp [a] [b] f x = None => None | Some y => Some (f y) +fun app [m] [a] (_ : monad m) (f : a -> m {}) x = + case x of + None => return () + | Some y => f y + fun bind [a] [b] f x = case x of None => None |