Existential.Net
The library for things that may or may not exist
Introduction
Existential is a utility library that contains parameter validation methods, a Maybe monad, and more. It can be used to:
- work effectively with nulls (Validate, Maybe<T>)
- log exceptions from an exception filter before they're handled or rethrown,
- efficiently resolve Code Analysis issues CA1062 and CA2000
- help generate a hash code, and
- convert the names of generic types into a familiar string representation.
It reduces the code you need to write for basic null checks by providing validation techniques or - even better - using the Maybe<T> monad can just help you not to care!
Other classes in Existential help you to avoid constantly reinventing the wheel for problems such as writing text to multiple outputs, converting an IEnumerable to an IEnumerable<T>, getting the name of the current method or negating a Predicate.
These solutions aren't innovative in themselves - plenty code examples exist out there - but Existential brings them together into one tested library so you don't have to.
To get started:
About the icon
Existential's icon is made up of two symbols from predicate logic:
- ∃ (there exists) and
- ∄ (there does not exist)
These are the two existential quantifiers , and capture the essence of what the Existential library is about.
About the name
Although there's a selection of utility classes in the library, I thought "Existential" captured what most of them were about - how do you deal with not knowing whether someting exists?
Why name it Existential.Net specifically? Well, I kind of wish I hadn't, as just "Existential" would be better now - but originally I was cross-compiling for use with JavaScript/TypeScript using the now defunct Bridge.Net, so there might have been an Existential.JS (it never reached release).
About the author
Gavin Greig's been a professional software developer since 1992, and a .NET developer since 2004. Existential.Net's the crystallisation of his experience of finding the bits he wishes weren't missing from .NET, often unearthed with the help of static code analysis tools.