home
/
code
/
hope.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add hope_option:iter/2
[hope.git]
/
src
/
hope_option.erl
diff --git
a/src/hope_option.erl
b/src/hope_option.erl
index
c461d04
..
d820b7b
100644
(file)
--- a/
src/hope_option.erl
+++ b/
src/hope_option.erl
@@
-9,6
+9,7
@@
[ put/2
, get/2
, map/2
+ , iter/2
]).
@@
-35,3
+36,8
@@
get(none , Y) -> Y.
t(B).
map({some, X}, F) -> {some, F(X)};
map(none , _) -> none.
+
+-spec iter(t(A), fun((A) -> (ok))) ->
+ ok.
+iter({some, X}, F) -> ok = F(X);
+iter(none , _) -> ok.
This page took
0.024985 seconds
and
4
git commands to generate.