X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fhope_result.erl;h=5d0ea7e42c40521a8a24f65b0fa0ce7f4701153c;hb=ed9905af6fa1dba6f89759d6dbfc970426122bde;hp=06f1eebd43f279d75d7f309fb55e77664b5a566c;hpb=3b156801097bcd07272f1db3a62a675495fa9d77;p=hope.git diff --git a/src/hope_result.erl b/src/hope_result.erl index 06f1eeb..5d0ea7e 100644 --- a/src/hope_result.erl +++ b/src/hope_result.erl @@ -1,5 +1,6 @@ -module(hope_result). + -export_type( [ t/2 ]). @@ -15,6 +16,13 @@ . +-spec pipe([F], X) -> + t(Ok, Error) + when X :: any() + , Ok :: any() + , Error :: any() + , F :: fun((X) -> t(Ok, Error)) + . pipe([] , X) -> X; pipe([F|Fs], X) -> case F(X)