Add hope_option:of_result/1 1.3.0
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 12 Dec 2014 04:48:16 +0000 (23:48 -0500)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 12 Dec 2014 04:48:59 +0000 (23:48 -0500)
src/hope.app.src
src/hope_option.erl

index 89c71bb..7167180 100644 (file)
@@ -1,7 +1,7 @@
 {application, hope,
  [
   {description, "Higher Order Programming in Erlang"},
-  {vsn, "1.2.0"},
+  {vsn, "1.3.0"},
   {registered, []},
   {applications, [
                   kernel,
index d820b7b..ab6eab7 100644 (file)
@@ -10,6 +10,7 @@
     , get/2
     , map/2
     , iter/2
+    , of_result/1
     ]).
 
 
@@ -41,3 +42,8 @@ map(none     , _) -> none.
     ok.
 iter({some, X}, F) -> ok = F(X);
 iter(none     , _) -> ok.
+
+-spec of_result(hope_result:t(A, _B)) ->
+    t(A).
+of_result({ok, X})    -> {some, X};
+of_result({error, _}) -> none.
This page took 0.031123 seconds and 4 git commands to generate.