Table of Contents

Class Iso

Namespace
Executables
Assembly
executables.dll

Factory methods for creating reversible transformations.

public static class Iso
Inheritance
Iso
Inherited Members

Methods

Create<T1, T2>(Func<T1, T2>, Func<T2, T1>)

Creates an isomorphism from forward and backward conversion functions.

[Pure]
public static IIso<T1, T2> Create<T1, T2>(Func<T1, T2> forward, Func<T2, T1> backward)

Parameters

forward Func<T1, T2>

Function that converts T1 to T2.

backward Func<T2, T1>

Function that converts T2 to T1.

Returns

IIso<T1, T2>

Isomorphism that delegates conversions to the provided functions.

Type Parameters

T1

Source type of the forward transformation.

T2

Source type of the backward transformation.

Exceptions

ArgumentNullException

forward or backward is null.

Identity<T>()

Returns an isomorphism that leaves values unchanged.

[Pure]
public static IIso<T, T> Identity<T>()

Returns

IIso<T, T>

Identity isomorphism.

Type Parameters

T

Value type.