Pfarah


ApplicativeParaValue

Namespace: Pfarah

Functions and values

Function or valueDescription
apply f m
Signature: f:ParaValue<('a -> 'b)> -> m:ParaValue<'a> -> ParaValue<'b>
Type parameters: 'a, 'b

If the wrapped function is a success and the given result is a success the function is applied on the value. Otherwise the exisiting error messages are propagated.

bind m f paravalue
Signature: m:ParaValue<'a> -> f:('a -> ParaValue<'b>) -> paravalue:ParaValue -> ParaResult<'b> * ParaValue
Type parameters: 'a, 'b

If a given result has a value, apply another function to the value

error e
Signature: e:string -> ParaValue<'a>
Type parameters: 'a

Creates an error from a given string

init a
Signature: a:'a -> ParaValue<'a>
Type parameters: 'a

Creates a ParaValue<'a> from a value

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

Maps the underlying value. If the result is currently an error the map does not happen

ofResult result para
Signature: result:ParaResult<'a> -> para:ParaValue -> ParaResult<'a> * ParaValue
Type parameters: 'a

Wraps a result into a ParaValue<'a>

wrap fn paravalue
Signature: fn:(ParaValue -> ParaResult<'a>) -> paravalue:ParaValue -> ParaResult<'a> * ParaValue
Type parameters: 'a

Given a function that given a ParaValue will return a ParaResult, wrap it into a ParaValue<'a>

Fork me on GitHub