Releases: san-smith/dfp
Releases · san-smith/dfp
v0.3.0
Added new methods to Option and Result.
Option:
flatMap- returns None or callsfwith the wrapped value and returnsSome(f(value));filter- returns None if the option is None or predicate returns false, otherwise returns Some.
Result:
flatMap- callsfif the result isOk, otherwise returns theErrvalue of self;flatMapErr- Callsfif the result isErr, otherwise returns theOkvalue of self.
Full Changelog: v0.2.1...v0.3.0
v0.2.1
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
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) andifOk,ifErr,ifOkElse,whenfor getting internal value using callbacks;- static method
flattenthat converts fromOption<Option<T>>toOption<T>and respectivelyResult<Result<T, E>, E>toResult<T, E>; - static method
transposefor 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%).