This library is quickly becoming a 'Base Class Library' for functional programming in C#. The features include:
Location | Feature | Description |
---|---|---|
Core |
Arr<A> |
Immutable array |
Core |
Lst<A> |
Immutable list |
Core |
Map<K, V> |
Immutable map |
Core |
Map<OrdK, K, V> |
Immutable map with Ord constraint on K |
Core |
HashMap<K, V> |
Immutable hash-map |
Core |
HashMap<EqK, K, V> |
Immutable hash-map with Eq constraint on K |
Core |
Set<A> |
Immutable set |
Core |
Set<OrdA, A> |
Immutable set with Ord constraint on A |
Core |
HashSet<A> |
Immutable hash-set |
Core |
HashSet<EqA, A> |
Immutable hash-set with Eq constraint on A |
Core |
Que<A> |
Immutable queue |
Core |
Stck<A> |
Immutable stack |
Core |
Option<A> |
Option monad that can't be used with null values |
Core |
OptionUnsafe<T> |
Option monad that can be used with null values |
Core |
Either<L,R> |
Right/Left choice monad that won't accept null values |
Core |
EitherUnsafe<L,R> |
Right/Left choice monad that can be used with null values |
Core |
Try<A> |
Exception handling lazy monad |
Core |
TryAsync<A> |
Asynchronous exception handling lazy monad |
Core |
TryOption<A> |
Option monad with third state 'Fail' that catches exceptions |
Core |
TryOptionAsync<A> |
Asynchronous Option monad with third state 'Fail' that catches exceptions |
Core |
Reader<E, A> |
Reader monad |
Core |
Writer<MonoidW, W, T> |
Writer monad that logs to a W constrained to be a Monoid |
Core |
State<S, A> |
State monad |
Core |
NewType<SELF, A, PRED> |
Haskell newtype equivalent i.e: class Hours : NewType<Hours, double> { public Hours(double value) : base(value) { } } . The resulting type is: equatable, comparable, foldable, a functor, monadic, and iterable |
Core |
NumType<SELF, NUM, A, PRED> |
Haskell newtype equivalent but for numeric types i.e: class Hours : NumType<Hours, TDouble, double> { public Hours(double value) : base(value) { } } . The resulting type is: equatable, comparable, foldable, a functor, a monoid, a semigroup, monadic, iterable, and can have basic artithmetic operations performed upon it. |
Core |
FloatType<SELF, FLOATING, A, PRED> |
Haskell newtype equivalent but for real numeric types i.e: class Hours : FloatType<Hours, TDouble, double> { public Hours(double value) : base(value) { } } . The resulting type is: equatable, comparable, foldable, a functor, a monoid, a semigroup, monadic, iterable, and can have complex artithmetic operations performed upon it. |
Core |
Nullable<T> extensions |
Extension methods for Nullable<T> that make it into a functor, applicative, foldable, iterable and a monad |
Core |
Task<T> extensions |
Extension methods for Task<T> that make it into a functor, applicative, foldable, iterable and a monad |
Core |
Monad transformers | A higher kinded type (ish) |
Core |
Currying | Translate the evaluation of a function that takes multiple arguments into a sequence of functions, each with a single argument |
Core |
Partial application | the process of fixing a number of arguments to a function, producing another function of smaller arity |
Core |
Memoization | An optimization technique used primarily to speed up programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again |
Core |
Improved lambda type inference | var add = fun( (int x, int y) => x + y) |
Core |
IObservable<T> extensions |