ResTDivision Operator

Limited ahd experimental for now; waiting for generics in operator overloading to be actually useful.

Returns the Err back when IsErr; Ok(map(Unwrap())) when IsOk.
C#
// session will be Err if the user is Err; Ok of a session for the user when Ok.
Res<Session> session = TryGetUser.Map(user => NewSession(user.Secrets));

Definition

Namespace: Orx.Fun.Result
Assembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
C#
public static Res<T> operator /(
	Res<T> result,
	Func<T, T> map
)

Parameters

result  ResT
Result to map.
map  FuncT, T
Function to map the result if it is of Ok variant.

Return Value

ResT

See Also