Skip to content

Releases: san-smith/dfp

v0.3.0

03 Jun 16:19
Compare
Choose a tag to compare

Added new methods to Option and Result.

Option:

  • flatMap - returns None or calls f with the wrapped value and returns Some(f(value));
  • filter - returns None if the option is None or predicate returns false, otherwise returns Some.

Result:

  • flatMap - calls f if the result is Ok, otherwise returns the Err value of self;
  • flatMapErr - Calls f if the result is Err, otherwise returns the Ok value of self.

Full Changelog: v0.2.1...v0.3.0

v0.2.1

31 May 17:53
Compare
Choose a tag to compare

Restricted the parameterized type E for tryCatch and asyncTryCatch.

Fixed typos in the README and expanded the description of Option class.

Full Changelog: v0.2.0...v0.2.1

v0.2.0

29 May 17:07
Compare
Choose a tag to compare

Added new type Result that represents either success (Ok) or failure (Err).

A number of new methods have been added for Result and Option:

  • ifSome, ifNone, ifSomeElse, when (Option) and ifOk, ifErr, ifOkElse, when for getting internal value using callbacks;
  • static method flatten that converts from Option<Option<T>> to Option<T> and respectively Result<Result<T, E>, E> to Result<T, E>;
  • static method transpose for both classes that transposes a Result of an Option into an Option of a Result (and vice versa);
  • added tests for all methods (code coverage is 100%).