v1.0.0
v1.0.0 Release
Taken from the wiki homepage.
Monad Marvels
Wrap C# values and objects in a variety of monads:
Maybe<T>- no more null! Values can beSome<T>containing a value, orNoneResult<T>- no more exceptions! Values can beOk<T>containing the value of a successful operation, orFailurecontaining information about why the operation failedId<T>- no more primitive IDs! Various types are provided for ID asGuid,int/uintorlong/ulong
Underlying all those types is IUnion<T> - the base interface that all the monads inherit from, containing one property: T Value. Also we have IEither<TLeft, TRight> which is the base interface for Maybe<T> and Result<T>: the 'left' value is the invalid / error value, and the 'right' value is the valid / success value.
This enables a functional style where pure functions can be joined / linked together to compose more complex functions, using extension methods like .Map() and .Bind().
Linq Loveliness
Where Maybe<T> and Result<T> really shine is when you get into Linq syntax, which enables a sequence of operations to be joined together - as soon as one fails the others are short-circuited, saving CPU cycles. For example:
from db in Db.ConnectAsync(...)
from query in BuildQuery(...)
from posts in db.QueryPosts<T>(query ...)
select posts;Assuming those three functions all return Result<T> the Linq query gives you a Result<T> object where T is the type of whatever you select.
Check out the source code for more info - I will expand the wiki with more info as and when I have time.