Releases: san-smith/dfp
Releases · san-smith/dfp
v0.3.0
Added new methods to Option
and Result
.
Option:
flatMap
- returns None or callsf
with the wrapped value and returnsSome(f(value))
;filter
- returns None if the option is None or predicate returns false, otherwise returns Some.
Result:
flatMap
- callsf
if the result isOk
, otherwise returns theErr
value of self;flatMapErr
- Callsf
if the result isErr
, otherwise returns theOk
value 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
,when
for getting internal value using callbacks;- static method
flatten
that converts fromOption<Option<T>>
toOption<T>
and respectivelyResult<Result<T, E>, E>
toResult<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%).