Pfarah


ParaResult

Namespace: Pfarah

Functions and values

Function or valueDescription
bind fn m
Signature: fn:('a -> ParaResult<'b>) -> m:ParaResult<'a> -> ParaResult<'b>
Type parameters: 'a, 'b

If the result is ok, extract the value and return the given function applied with the value, else continue propogating error

choose arr
Signature: arr:ParaResult<'a> [] -> ParaResult<'a []>
Type parameters: 'a

Takes an array of results and if all elements are ok then a result of array is returned else the first error

defaultOpt fn def opt
Signature: fn:(ParaValue -> ParaResult<'a>) -> def:'a -> opt:ParaValue option -> ParaResult<'a>
Type parameters: 'a

If the option is present, return inner value applied to the function. else return a default value wrapped in a result.

get _arg1
Signature: _arg1:ParaResult<'a> -> 'a
Type parameters: 'a

Get the underlying value or throw an exception

map f m
Signature: f:('a -> 'b) -> m:ParaResult<'a> -> ParaResult<'b>
Type parameters: 'a, 'b

If the result is ok, extract the value and apply the given function on the value and wrap it in an result, else continue propogating error

Fork me on GitHub