Simple optional types with basic helpers and converters
Maybe<T>value or nothingTry<T>value or errorEither<TLeft, TRight>value either value
AInq.Optional - Types and basic helpers
AInq.Optional.Async - Async helpers and extensions
Large refactoring and internal optimization with some breaking changes
- Remove build targets for STS .Net versions
System.Linqis used for collection extensions, which may cause minor behavior changesSystem.Linq.AsyncEnumerableis used in .net10 with minor API changes- Change some methods to remove ambiguity
- Rename
Maybe.AsTrytoMaybe.TryValue - Rename
Try.AsMaybetoTry.MaybeValue - Rename converter
Maybe.OrtoMaybe.EitherValue - Make
boolcast operators explicit
- Rename
- Remove all
Try<T>extensions, which can implicitly hide exceptions Try.MaybeValuenow throw exception if source is not success, introduced flag to suppress this- Save exception stacktrace in
Try<T> - New APIs
|(or) operator forMaybe<T>!(not) operator forMaybe<T>andTry<T>!(invert) operator forEither<TLeft, TRight>Maybe.Valuescollection extension with filteringTry.Resultwith additional generator parameter
For version 3.0 this lib was completely rewritten with some breaking changes
- All types are now
classinstead ofstruct - Remove some logically obscure methods
IComparableimplementation (problems with comparingnulland empty item)- Type cast operators (unused)
Try.SelectOrDefaultandTry.ValueOrDefault(implicitly hides error, can be replaced withTry.AsMaybe)
- Async extensions completely rewritten using
ValueTaskand moved to separate package
If you find a bug, have a question or something else - you are friendly welcome to open an issue.
Copyright © 2021 Anton Andryushchenko. AInq.Optional is licensed under Apache License 2.0
