Skip to content

Instantly share code, notes, and snippets.

View Bert-Proesmans's full-sized avatar

Proesmans Bert Bert-Proesmans

View GitHub Profile
@johnazariah
johnazariah / LinqExtensions.cs
Last active November 15, 2024 13:04
Maybe Monad in C#
public static partial class LinqExtensions
{
public static Maybe<C> SelectMany<A, B, C>(this Maybe<A> ma, Func<A, Maybe<B>> f, Func<A, B, C> select) => ma.Bind(a => f(a).Map(b => select(a, b)));
}