oxidized 6.2.0 oxidized: ^6.2.0 copied to clipboard
Definitions of Rust-like types, Option and Result, to promote safer programming.
Change Log #
All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. This file follows the convention described at Keep a Changelog.
[6.1.0] - 2023-07-15 #
Added #
- amaxcz: add
matchOk()
,matchErr()
, andunwrapOrNull()
functions toResult
- amaxcs:
unwrap()
function now contains the original error message
[6.0.0] - 2023-06-19 #
Changed #
- Now requires Dart SDK version 3 or higher.
- BREAKING CHANGE: Both
Option
andResult
are nowsealed
classes which allows for the use of exhaustive pattern matching. - feelsantiago: introduced the
sealed
class change toOption
andResult
.
[5.3.0] - 2023-01-13 #
[5.2.0] - 2022-02-10 #
Added #
- rlch: Added async methods to
Option<T>
andResult<T, E>
. - rlch: Added missing type arguments to
Option<T>
andResult<T, E>
. - rlch: Added code coverage for async methods.
- rlch: Added
OptionFutureRedirector
util to redirect methods called onFuture<Option<T>>
. - rlch: Added
ResultFutureRedirector
util to redirect methods called onFuture<Result<T, E>>
.
[5.1.0] - 2021-09-20 #
Added #
- kranfix:
Option<Result<T, E>>.transpose()
returns aResult<Option<T>, E>
. - kranfix:
Option<Option<T>>.flatten()
returns anOption<T>
. - kranfix:
Result<Option<T>, E>.transpose()
returns anOption<Result<T, E>>
. - kranfix:
Result<Result<T, E>, E>.flatten()
returns aResult<T, E>
.
[5.0.1] - 2021-08-24 #
Changed #
- kranfix: Fixed equality operator for
Option
andResult
. - kranfix: Added more code coverage in unit tests.
[5.0.0] - 2021-08-11 #
Changed #
- BREAKING CHANGE: can no longer pass
null
toResult
. The rectifies the inconsistent handling of null values with regards toOption
andResult
. - kranfix: refactored
Option<T extends Object>
to fixResult<int?, Exception>.ok(null).ok()
- kranfix: refactored
Result<T extends Object, E extends Object>
to fixResult<int?, Exception>.ok(null)
[4.2.0] - 2021-04-30 #
Added #
- lemunozm: added
isSome()
,isNone()
toOption
. - lemunozm: added
isOk()
,isErr()
toResult
. - lemunozm: added
Option.from()
andOption.toNullable()
to make easy conversions with nullable values. - Added a
Unit
type that is similar to Rust's()
type.
[4.1.0] - 2021-03-09 #
Changed #
- lemunozm: return values added to
match()
,when()
inResult
,Option
.
[3.0.0] - 2020-03-18 #
Changed #
- BREAKING CHANGES: see below for the details.
- The
Result
"ok" and "error" values are full-fledged classes now. - The
Option
"some" and "none" values are full-fledged classes now. Option.isSome()
andOption.isNone()
are gone, useis Some
andis None
.Result.isOk()
andResult.isErr()
are gone, useis Ok
andis Err
.- The default
Result
constructor has been renamed toof()
instead. - Passing
null
to theOption.some()
factory constructor will yield aNone
. - Both the
Ok
andErr
subclasses ofResult
allow for null arguments.