26 -spec put(A, fun((A) -> boolean())) ->
34 -spec get(t(A), Default :: A) ->
36 get({some, X}, _) -> X;
44 -spec map(t(A), fun((A) -> (B))) ->
46 map({some, X}, F) -> {some, F(X)};
47 map(none , _) -> none.
49 -spec iter(t(A), fun((A) -> (ok))) ->
51 iter({some, X}, F) -> ok = F(X);
54 -spec pipe([fun((A) -> t(B))], A) ->
61 ; {some, Y} -> pipe(Fs, Y)
64 -spec of_result(hope_result:t(A, _B)) ->
66 of_result({ok, X}) -> {some, X};
67 of_result({error, _}) -> none.