Table of Contents

Class Erratic

Namespace
LfrlAnvil.Functional
Assembly
LfrlAnvil.Functional.dll

Creates instances of Erratic<T> type.

public static class Erratic
Inheritance
Erratic
Inherited Members

Methods

GetUnderlyingType(Type?)

Attempts to extract the underlying type from the provided Erratic<T>type.

[Pure]
public static Type? GetUnderlyingType(Type? type)

Parameters

type Type

Type to extract the underlying type from.

Returns

Type

Underlying Erratic<T> type or null when the provided type is not related to the Erratic<T> type.

Try(Action)

Creates a new Erratic<T> from the provided action delegate invocation result wrapped in a try-catch block.

[Pure]
public static Erratic<Nil> Try(Action action)

Parameters

action Action

Delegate to invoke.

Returns

Erratic<Nil>

New Erratic<T> instance with Nil value type.

Try<T>(Func<T>)

Creates a new Erratic<T> from the provided func delegate invocation result wrapped in a try-catch block.

[Pure]
public static Erratic<T> Try<T>(Func<T> func)

Parameters

func Func<T>

Delegate to invoke.

Returns

Erratic<T>

New Erratic<T> instance.

Type Parameters

T

Value type.