Table of Contents

Delegate TryGet<TResult>

Namespace
SodaFlow.Functional
Assembly
SodaFlow.Functional.dll

A method that gives a value if it can. It reports the result through its return value, and gives the value through an output parameter.

[PublicAPI]
public delegate bool TryGet<TResult>(out TResult result)

Parameters

result TResult

Set to the value produced when this returns true, and left at the default for its type otherwise.

Returns

bool

true for a value, and false for none.

Type Parameters

TResult

The type of the value produced.

Extension Methods

Remarks

This gives the shape that the framework uses everywhere it has to say "there can be no answer" with no exception. That name is what lets FromTryGet<TResult>(TryGet<TResult>) change each such method into a Maybe<T>, and that includes ones this library knows nothing about.