InCube Core is a set of C# libraries that provides extensions for functional
programming, standard collection types, value parsing and formatting, and more.
Consult the wiki for additional resources.
Adding InCube Core to your build
Binary packages of InCube Core are available on nuget.org. Add the following lines to your .csproj in order to use the library in your .Net Core build:
A wrapper designed along the lines of Nullable<T> that supports struct and reference types. See the Option User Guide and OptionDemo for an introduction and examples. AnyDemo shows a simplified implementation.
Holds the result of some computation of type T or an Exception.
All of the data types above implement the IEnumerable<T> interface. They can be
viewed as a container which holds at most one valid element t of type T.
InCube Core provides container-like extension methods for all these data types
as well as for Nullable<T>.
Property / Method
Description
None
Create an empty wrapper.
Some
Create a wrapper holding a valid element t.
HasValue
Indicates whether a wrapper holds a valid element t.
Returns either t or produces a new value by calling a function delegate. The delegate may be used to throw a more meaningful exception than by accessing Value directly.
Select
Apply a mapping function to t.
SelectMany
Apply a mapping function to t that returns a wrapper type and flatten (corresponds to flatMap).