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
forwardFunc<T1, T2>Function that converts
T1toT2.backwardFunc<T2, T1>Function that converts
T2toT1.
Returns
- IIso<T1, T2>
Isomorphism that delegates conversions to the provided functions.
Type Parameters
T1Source type of the forward transformation.
T2Source type of the backward transformation.
Exceptions
- ArgumentNullException
forwardorbackwardis 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
TValue type.