Table of Contents

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

func Func<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

T1
T2

Exceptions

ArgumentNullException

func is null.

Create(Action)

Creates an executable from a parameterless action.

[Pure]
public static IExecutable<Unit, Unit> Create(Action action)

Parameters

action Action

Action used for execution.

Returns

IExecutable<Unit, Unit>

Exceptions

ArgumentNullException

action is null.

Create<T>(Action<T>)

Creates an executable from an action.

[Pure]
public static IExecutable<T, Unit> Create<T>(Action<T> action)

Parameters

action Action<T>

Action used for execution.

Returns

IExecutable<T, Unit>

Type Parameters

T

Exceptions

ArgumentNullException

action is null.

Create<T>(Func<T>)

Creates an executable from a parameterless function.

[Pure]
public static IExecutable<Unit, T> Create<T>(Func<T> func)

Parameters

func Func<T>

Function used for execution.

Returns

IExecutable<Unit, T>

Type Parameters

T

Exceptions

ArgumentNullException

func is 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

action Action<T1, T2>

Action used for execution.

Returns

IExecutable<(T1, T2), Unit>

Executable that accepts a 2-tuple input and returns Unit.

Type Parameters

T1
T2

Exceptions

ArgumentNullException

action is 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

func Func<T1, T2>

Function used for execution.

Returns

IExecutable<T1, T2>

Type Parameters

T1
T2

Exceptions

ArgumentNullException

func is 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

action Action<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

T1
T2
T3

Exceptions

ArgumentNullException

action is 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

func Func<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

T1
T2
T3

Exceptions

ArgumentNullException

func is 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

action Action<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

T1
T2
T3
T4

Exceptions

ArgumentNullException

action is 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

func Func<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

T1
T2
T3
T4

Exceptions

ArgumentNullException

func is 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

func Func<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

T1
T2
T3
T4
T5

Exceptions

ArgumentNullException

func is 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

executable IExecutable<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

T1
T2

Exceptions

ArgumentNullException

executable is 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

func Func<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

T1
T2

Exceptions

ArgumentNullException

func is 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

first IExecutable<T1, T2>

First executable branch.

second IExecutable<T1, T3>

Second executable branch.

Returns

IExecutable<T1, (T2, T3)>

Executable that returns the results of both branches as a tuple.

Type Parameters

T1
T2
T3

Exceptions

ArgumentNullException

first or second is 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

first Func<T1, T2>

First delegate branch.

second Func<T1, T3>

Second delegate branch.

Returns

IExecutable<T1, (T2, T3)>

Executable that returns the results of both branches as a tuple.

Type Parameters

T1
T2
T3

Exceptions

ArgumentNullException

first or second is 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