polyadic / funcky

Funcky is a Functional Library for C#
https://polyadic.github.io/funcky
Apache License 2.0
19 stars 4 forks source link

Experimental idea: IsBetween with explicit Inclusive and Exlusive boundaries #783

Open FreeApophis opened 8 months ago

FreeApophis commented 8 months ago

Main Idea:

I want a "IsBetween" extension on number types (just int in the experiment) which I can chose if the boundary are inclusive or exclusive.

12.IsBetween<Including, Excluding>(0, 20)

This was a lot easier than I thought, I defined a common interface IIntervalBoundary and two implementations Inclusive and Exclusive with private constructors and public implicit operators.