using System.Threading.Tasks;
using CSharpFunctionalExtensions;
public static async Task<Result<string>> GetAResultAsync()
return await Task.FromResult(Result.Success<string>("a"));
public static Result<string> GetBResult(string a)
return Result.Success<string>(a + "b");
public static async Task<string> GetCResultAsync(string b)
return await Task.FromResult(b + "c");
public static async Task<Result<string>> GetDResultAsync(string c)
return await Task.FromResult(Result.Success<string>(c + "d"));
public static async Task WriteResult()
var r = await Result.Success()
.Tap(b => Console.WriteLine(b))
.Tap(d => Console.WriteLine(d))
.TapError(error => Console.WriteLine(error));
var y = Result.Success().Bind(() => Result.Success());
public static async Task Main()