Skip to content

Releases: DigitecGalaxus/Galaxus.Functional

4.2.1

28 Nov 07:03
5d731ff
Compare
Choose a tag to compare

Add ConfigureAwait(false) to all awaited calls for async-extensions

4.2.0

20 Aug 12:24
38ff5fa
Compare
Choose a tag to compare

Add Option.MapOrElse plus matching async variants

4.1.0

16 Jan 14:41
e8d6b49
Compare
Choose a tag to compare

New features

  • Added extension Option.MatchAsync with all possible variants

4.0.0

23 Dec 06:59
97eb59d
Compare
Choose a tag to compare

New features

  • New package Galaxus.Functional.NUnit to make writing assertions on Options and Results easier
    • Example: Assert.That(myOption, Is.Some.WithValue.EqualTo(1)) or Assert.That(myResult, Is.Err)

Breaking changes

  • Renamed AttemptToUnwrapNoneWhenOptionContainedSomeException to TriedToUnwrapNoneException
  • Renamed AttemptToUnwrapErrWhenResultWasOkException to TriedToUnwrapErrException
  • Removed Option.UnwrapOrDefault and Result.UnwrapOrDefault (plus their async variants)
    • For Option, you can use ToNullable instead!
  • All the SomethingAsync-methods (like e.g. MatchAsync) are now consistently implemented as extension methods
    • If you're relying on automatic type conversion, you probably have to specify the type parameters explicitly for these cases now

3.5.0

11 Aug 15:02
a874f38
Compare
Choose a tag to compare

This release brings two new methods; one for convertign Options to Eithers and another to bring the FirstOrNone-style operations to Dictionary.

Using someOption.ToEither(fallback), you can turn an Option<TSome> into an Either<TSome, TFallback>. As expected, Some will be the A while the provided fallback will be used as B if the option is None.

Using dictionary.GetValueOrNone(key), you can extract a value from a dictionary - or not, if the key is not present - similar to how FirstOrNone and others work.

3.4.0

27 Jun 13:36
Compare
Choose a tag to compare

Another two improvements for Either<A, B> and Either<A, B, C>: Match now has an async variant that allows any of the delegates to be a function returning a task - which is something Result<TOk, TErr> has supported for a long time now.

3.3.0

26 Jan 13:20
bcfa261
Compare
Choose a tag to compare

Both Either<A, B> and Either<A, B, C> just got a lot better! Instead of manually checking which discriminant the either is, you can check directly using IsA, IsB and IsC which does what you'd expect. In addition to that, there's also SelectA, SelectB and SelectC for an enumerable of eithers. Similar to SelectSome, they allow you to iterate over all Eithers that are A.. or B or C.

3.2.0

17 Oct 11:21
70110cf
Compare
Choose a tag to compare

There are now extensions for Option and Result to allow asynchronous Unwrapping. Also, the LINQ-Extensions added in 3.1.0 are now better than before, handling infinite enumerables with ease.

3.1.1

08 Sep 08:46
950e55a
Compare
Choose a tag to compare

Just a minor patch to use a less-blurry icon

3.1.0

07 Sep 05:17
0ab1e99
Compare
Choose a tag to compare

Version 3.1.0 includes shiny new extensions as alternatives to well-known LINQ methods like SingleOrDefault which will return None instead of default and are aptly named SingleOrNone (and similar).