Add specs.
[hope.git] / src / hope_option.erl
index 622c06d..c461d04 100644 (file)
     .
 
 
+-spec put(A, fun((A) -> boolean())) ->
+    t(A).
 put(X, F) ->
     case F(X)
     of  true  -> {some, X}
     ;   false -> none
     end.
 
+-spec get(t(A), Default :: A) ->
+    A.
 get({some, X}, _) -> X;
 get(none     , Y) -> Y.
 
+-spec map(t(A), fun((A) -> (B))) ->
+    t(B).
 map({some, X}, F) -> {some, F(X)};
 map(none     , _) -> none.
This page took 0.019391 seconds and 4 git commands to generate.