home
/
code
/
hope.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Implement hope_option:of_undefined/1
[hope.git]
/
src
/
hope_option.erl
diff --git
a/src/hope_option.erl
b/src/hope_option.erl
index
180c416
..
529158d
100644
(file)
--- a/
src/hope_option.erl
+++ b/
src/hope_option.erl
@@
-14,6
+14,7
@@
, iter/2
, pipe/2
, of_result/1
+ , of_undefined/1
]).
@@
-65,3
+66,8
@@
pipe([F|Fs], X) ->
t(A).
of_result({ok, X}) -> {some, X};
of_result({error, _}) -> none.
+
+-spec of_undefined(undefined | A) ->
+ t(A).
+of_undefined(undefined) -> none;
+of_undefined(X) -> {some, X}.
This page took
0.024589 seconds
and
4
git commands to generate.