Class ErraticExtensions
- Namespace
- LfrlAnvil.Functional.Extensions
- Assembly
- LfrlAnvil.Functional.dll
Contains Erratic<T> extension methods.
public static class ErraticExtensions- Inheritance
- 
      
      ErraticExtensions
- Inherited Members
Methods
Reduce<T>(Erratic<Erratic<T>>)
Creates a new Erratic<T> instance.
[Pure]
public static Erratic<T> Reduce<T>(this Erratic<Erratic<T>> source)Parameters
Returns
- Erratic<T>
- New Erratic<T> instance equivalent to the value of - sourcewhen IsOk of- sourceis equal to true otherwise a new Erratic<T> instance equivalent to the error of- source.
Type Parameters
- T
- Value type. 
ToEither<T>(Erratic<T>)
Creates a new Either<T1, T2> instance.
[Pure]
public static Either<T, Exception> ToEither<T>(this Erratic<T> source)Parameters
- sourceErratic<T>
- Source erratic. 
Returns
- Either<T, Exception>
- New Either<T1, T2> instance equivalent to the value of - sourcewhen IsOk of- sourceis equal to true otherwise a new Either<T1, T2> instance equivalent to the error of- source.
Type Parameters
- T
- Value type. 
ToMaybe<T>(Erratic<T>)
Creates a new Maybe<T> instance.
[Pure]
public static Maybe<T> ToMaybe<T>(this Erratic<T> source) where T : notnullParameters
- sourceErratic<T>
- Source erratic. 
Returns
- Maybe<T>
- New Maybe<T> instance equivalent to the provided - sourceor None when- sourcedoes not have a value.
Type Parameters
- T
- Value type.