Class Executable
- Namespace
- Executables
- Assembly
- executables.dll
Factory methods for creating executables.
public static class Executable
- Inheritance
-
Executable
- Inherited Members
Methods
Accumulate<T1, T2>(Func<T1, T2>)
Creates an executable that preserves its input and appends a computed value.
[Pure]
public static IExecutable<T1, (T1, T2)> Accumulate<T1, T2>(Func<T1, T2> func)
Parameters
funcFunc<T1, T2>Delegate that computes an additional value from the input.
Returns
- IExecutable<T1, (T1, T2)>
Executable that returns both the original input and the computed value.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Create(Action)
Creates an executable from a parameterless action.
[Pure]
public static IExecutable<Unit, Unit> Create(Action action)
Parameters
actionActionAction used for execution.
Returns
Exceptions
- ArgumentNullException
actionis null.
Create<T>(Action<T>)
Creates an executable from an action.
[Pure]
public static IExecutable<T, Unit> Create<T>(Action<T> action)
Parameters
actionAction<T>Action used for execution.
Returns
- IExecutable<T, Unit>
Type Parameters
T
Exceptions
- ArgumentNullException
actionis null.
Create<T>(Func<T>)
Creates an executable from a parameterless function.
[Pure]
public static IExecutable<Unit, T> Create<T>(Func<T> func)
Parameters
funcFunc<T>Function used for execution.
Returns
- IExecutable<Unit, T>
Type Parameters
T
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2>(Action<T1, T2>)
Creates an executable from an action with two arguments.
[Pure]
public static IExecutable<(T1, T2), Unit> Create<T1, T2>(Action<T1, T2> action)
Parameters
actionAction<T1, T2>Action used for execution.
Returns
- IExecutable<(T1, T2), Unit>
Executable that accepts a 2-tuple input and returns Unit.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2>(Func<T1, T2>)
Creates an executable from a function.
[Pure]
public static IExecutable<T1, T2> Create<T1, T2>(Func<T1, T2> func)
Parameters
funcFunc<T1, T2>Function used for execution.
Returns
- IExecutable<T1, T2>
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3>(Action<T1, T2, T3>)
Creates an executable from an action with three arguments.
[Pure]
public static IExecutable<(T1, T2, T3), Unit> Create<T1, T2, T3>(Action<T1, T2, T3> action)
Parameters
actionAction<T1, T2, T3>Action used for execution.
Returns
- IExecutable<(T1, T2, T3), Unit>
Executable that accepts a 3-tuple input and returns Unit.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2, T3>(Func<T1, T2, T3>)
Creates an executable from a function with two arguments.
[Pure]
public static IExecutable<(T1, T2), T3> Create<T1, T2, T3>(Func<T1, T2, T3> func)
Parameters
funcFunc<T1, T2, T3>Function used for execution.
Returns
- IExecutable<(T1, T2), T3>
Executable that accepts a 2-tuple input and returns function result.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3, T4>(Action<T1, T2, T3, T4>)
Creates an executable from an action with four arguments.
[Pure]
public static IExecutable<(T1, T2, T3, T4), Unit> Create<T1, T2, T3, T4>(Action<T1, T2, T3, T4> action)
Parameters
actionAction<T1, T2, T3, T4>Action used for execution.
Returns
- IExecutable<(T1, T2, T3, T4), Unit>
Executable that accepts a 4-tuple input and returns Unit.
Type Parameters
T1T2T3T4
Exceptions
- ArgumentNullException
actionis null.
Create<T1, T2, T3, T4>(Func<T1, T2, T3, T4>)
Creates an executable from a function with three arguments.
[Pure]
public static IExecutable<(T1, T2, T3), T4> Create<T1, T2, T3, T4>(Func<T1, T2, T3, T4> func)
Parameters
funcFunc<T1, T2, T3, T4>Function used for execution.
Returns
- IExecutable<(T1, T2, T3), T4>
Executable that accepts a 3-tuple input and returns function result.
Type Parameters
T1T2T3T4
Exceptions
- ArgumentNullException
funcis null.
Create<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5>)
Creates an executable from a function with four arguments.
[Pure]
public static IExecutable<(T1, T2, T3, T4), T5> Create<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5> func)
Parameters
funcFunc<T1, T2, T3, T4, T5>Function used for execution.
Returns
- IExecutable<(T1, T2, T3, T4), T5>
Executable that accepts a 4-tuple input and returns function result.
Type Parameters
T1T2T3T4T5
Exceptions
- ArgumentNullException
funcis null.
FlatMap<T1, T2>(IExecutable<T1, IExecutable<T1, T2>>)
Flattens an executable that returns another executable into a single executable.
[Pure]
public static IExecutable<T1, T2> FlatMap<T1, T2>(IExecutable<T1, IExecutable<T1, T2>> executable)
Parameters
executableIExecutable<T1, IExecutable<T1, T2>>Executable that returns the next executable to run for the same input.
Returns
- IExecutable<T1, T2>
Executable that executes the returned executable and exposes its result directly.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
executableis null.
FlatMap<T1, T2>(Func<T1, IExecutable<T1, T2>>)
Creates a flattened executable from a delegate that selects the next executable to run.
[Pure]
public static IExecutable<T1, T2> FlatMap<T1, T2>(Func<T1, IExecutable<T1, T2>> func)
Parameters
funcFunc<T1, IExecutable<T1, T2>>Delegate that returns the next executable for the provided input.
Returns
- IExecutable<T1, T2>
Executable that executes the returned executable and exposes its result directly.
Type Parameters
T1T2
Exceptions
- ArgumentNullException
funcis null.
Fork<T1, T2, T3>(IExecutable<T1, T2>, IExecutable<T1, T3>)
Creates an executable that runs two executables for the same input and returns both results.
[Pure]
public static IExecutable<T1, (T2, T3)> Fork<T1, T2, T3>(IExecutable<T1, T2> first, IExecutable<T1, T3> second)
Parameters
firstIExecutable<T1, T2>First executable branch.
secondIExecutable<T1, T3>Second executable branch.
Returns
- IExecutable<T1, (T2, T3)>
Executable that returns the results of both branches as a tuple.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
firstorsecondis null.
Fork<T1, T2, T3>(Func<T1, T2>, Func<T1, T3>)
Creates an executable that runs two delegates for the same input and returns both results.
[Pure]
public static IExecutable<T1, (T2, T3)> Fork<T1, T2, T3>(Func<T1, T2> first, Func<T1, T3> second)
Parameters
Returns
- IExecutable<T1, (T2, T3)>
Executable that returns the results of both branches as a tuple.
Type Parameters
T1T2T3
Exceptions
- ArgumentNullException
firstorsecondis null.
Identity()
Returns a parameterless executable that returns Unit unchanged.
[Pure]
public static IExecutable<Unit, Unit> Identity()
Returns
- IExecutable<Unit, Unit>
Identity executable for Unit.
Identity<T>()
Returns an executable that returns its input unchanged.
[Pure]
public static IExecutable<T, T> Identity<T>()
Returns
- IExecutable<T, T>
Type Parameters
T