Funny 1.0.8

Funny - Railway oriented programming library in C#.

Provides a functional programming approach to handle exceptions in an elegant way and to avoid NullReferenceExceptions.

Install-Package Funny -Version 1.0.8
dotnet add package Funny --version 1.0.8
<PackageReference Include="Funny" Version="1.0.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Funny --version 1.0.8
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Funny

Functional programming must be Funny!

Railway oriented programming library in C#. Provides a functional programming approach to handle exceptions in an elegant way and to avoid NullReferenceExceptions.

Build status

Result&lt;T&gt;

Encapsulate a return value. No more NullReferenceExceptions!!

Result<TestClass> result = service.GetTestClassValue();

// Using pattern matching to get a success value, error or none.
int resultValue = result
            .GetValue(
                onSuccess:  value => 1, 
                onError:    error => -1,
                isNone:  () => 0
            );

Enables the chaining of executions using fluent interface.

public IActionResult Index()
    => service.GetItens()
              .Then(list => service.ProcessProductList(list)) 
              .Then(list => service.CreateOrder(list)) 
              .Then(order => service.CalculateTotal(order))
              .Catch(error => SaveErrorLog(error))
              .GetValue(
                  onSuccess:  total => View(total),
                  onError:    error => View("Error", error),
                  isNone:     () => View()
              );

Funny

Functional programming must be Funny!

Railway oriented programming library in C#. Provides a functional programming approach to handle exceptions in an elegant way and to avoid NullReferenceExceptions.

Build status

Result&lt;T&gt;

Encapsulate a return value. No more NullReferenceExceptions!!

Result<TestClass> result = service.GetTestClassValue();

// Using pattern matching to get a success value, error or none.
int resultValue = result
            .GetValue(
                onSuccess:  value => 1, 
                onError:    error => -1,
                isNone:  () => 0
            );

Enables the chaining of executions using fluent interface.

public IActionResult Index()
    => service.GetItens()
              .Then(list => service.ProcessProductList(list)) 
              .Then(list => service.CreateOrder(list)) 
              .Then(order => service.CalculateTotal(order))
              .Catch(error => SaveErrorLog(error))
              .GetValue(
                  onSuccess:  total => View(total),
                  onError:    error => View("Error", error),
                  isNone:     () => View()
              );

  • .NETStandard 2.0

    • No dependencies.

Version History

Version Downloads Last updated
1.0.8 68 3/20/2019
1.0.7 36 3/18/2019
1.0.6 34 3/18/2019
1.0.5 60 2/22/2019
1.0.4 52 2/22/2019
1.0.3 49 2/21/2019
1.0.2 84 10/30/2018
1.0.1 124 10/11/2018
1.0.0 109 10/5/2018