OptionExtensionsMap Method

Overload List

MapT1, T2, TOut(OptValueTupleT1, T2, FuncT1, T2, TOut) Allows an option of a tuple (t1, t2) to map with a function taking two arguments t1 and t2.
C#
static int Add(int a, int b) => a + b;

var numbers = Some((1, 2));
var sum = numbers.Map(Add);
Assert(sum == Some(3));
This is mostly useful in enabling function composition.
MapT1, T2, TOut(OptValueTupleT1, T2, FuncT1, T2, TaskTOut) (async version) Allows an option of a tuple (t1, t2) to map with a function taking two arguments t1 and t2.
C#
static int Add(int a, int b) => a + b;

var numbers = Some((1, 2));
var sum = numbers.Map(Add);
Assert(sum == Some(3));
This is mostly useful in enabling function composition.

See Also