Class UnitExtensionMethods
- Namespace
- SodaFlow.Functional
- Assembly
- SodaFlow.Functional.dll
Extension methods for basic type conversion helpers.
[PublicAPI]
public static class UnitExtensionMethods
- Inheritance
-
UnitExtensionMethods
- Inherited Members
Remarks
C# splits what is one idea in a functional language into two:
Action and Func<TResult>. Thus,
anything with a function parameter accepts no action. These conversions
remove that difference, thus one implementation taking a function can serve
the two - which is how, for instance, Maybe<T>.Match expresses
Maybe<T>.MatchVoid.
Methods
- Ignore<T>(T)
Discards a value and gives Unit as the replacement.
- ToAsyncFunc(Func<Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T>(Func<T, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2>(Func<T1, T2, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3>(Func<T1, T2, T3, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4>(Func<T1, T2, T3, T4, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToAsyncFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Task>)
Changes an asynchronous action into a function that gives Unit. The result can go where a function that returns a value is necessary.
- ToFunc(Action)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T>(Action<T>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2>(Action<T1, T2>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3>(Action<T1, T2, T3>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4>(Action<T1, T2, T3, T4>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- ToFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)
Changes an action into a function that returns Unit. The result can go where a function that returns a value is necessary.
- Upcast<T>(T)
Gives the value as the given type. This names the target type, where type inference gives the type of the value.