rustic 0.5.2
rustic: ^0.5.2 copied to clipboard
Various constructs inspired by the Rust programming language.
0.5.2 #
Another hotfix that corrects a compilation error.
- Fix
option/Option.zipunable to compile due to a type error that the analyzer missed.
0.5.1 #
This is a hotfix release to restore the flexibility of the collect functions that was accidentally dropped in the previous version.
- Make collect functions generic over the value type.
0.5.0 #
This is the largest release since the initial one, adding, removing, or otherwise changing countless items. The main driver for this is the arrival of Dart 3, which this package will require as a minimum going forward.
The Tuple types (including Unit) have been stripped, as Dart 3 comes with tuples built into the
language in the form of records. With this change, the complete tuple library goes away.
The asynchronous versions of all instance methods have also been removed, as it has become
straightforward to provide their functionality in user code with the new language constructs,
should there be a need. Instead of rustic including an asnychronous version of all methods, one
can, for the most part, simply turn to the new switch expression, if they really must execute
asynchronous code when manipulating or otherwise working with rustic. This change might make
migration to the new version more difficult in certain cases, but reduces confusion and maintenance
in the long run. Real-world usage indicated that the asynchronous versions are seldom used, anyway.
- [BREAKING] Require Dart 3.
- Add the
option/Optionalextension. This replaces theOptionableextension. - Add the
option/FlattenedOptionextension. This replaces theOptionalOptionextension. - Add the
option/UnzippedOptionextension. - Add the
option/TransposedOptionextension. This replaces theOptionalResultextension. - Add the
option/Option.collectmethod. - Add the
option/Option.collectAsyncmethod. - Add the
option/Option.inspectmethod. - Add the
option/Option.isSomeAndmethod. - Add the
option/Option.mapOrmethod. - Add the
option/Option.mapOrElsemethod. - Add the
option/Option.unwrapOrmethod. - Add the
option/Option.unwrapOrElsemethod. - Add the
option/Option.valueOrNullgetter. - Add the
result/FlattenedResultextension. This replaces theResultingResultextension. - Add the
result/TransposedResultextension. This replaces theResultingOptionextension. - Add the
result/Result.collectAsyncmethod. - Add the
result/Result.errorOrNullgetter. - Add the
result/Result.inspectmethod. - Add the
result/Result.inspectErrmethod. - Add the
result/Result.isErrAndmethod. - Add the
result/Result.isOkAndmethod. - Add the
result/Result.mapErrOrmethod. - Add the
result/Result.mapErrOrElsemethod. - Add the
result/Result.mapOrmethod. - Add the
result/Result.mapOrElsemethod. - Add the
result/Result.unwrapErrOrmethod. - Add the
result/Result.unwrapErrOrElsemethod. - Add the
result/Result.unwrapOrmethod. - Add the
result/Result.unwrapOrElsemethod. - Add the
result/Result.valueOrNullgetter. - [BREAKING] Rename the
option/Option.andSyncmethod toandThen. - [BREAKING] Remove the
option/Option.asPlainmethod. Use thevalueOrNullgetter instead. - [BREAKING] Rename the
option/Option.mapSyncmethod tomap. This new method no longer accepts a callback to calculate a fallback value. If a fallback value is desired, usemapOrormapOrElseinstead. - [BREAKING] Remove the
option/Option.matchmethod. - [BREAKING] Remove the
option/Option.matchSyncmethod. - [BREAKING] Rename the
option/Option.okOrSyncmethod tookOrElse. - [BREAKING] Rename the
option/Option.orSyncmethod toorElse. - [BREAKING] Remove the
option/Option.unwrapNonemethod. - [BREAKING] Rename the
option/Option.unwrapSyncmethod tounwrap. This new method no longer accepts a callback to calculate a fallback value. If a fallback value is desired, useunwrapOrorunwrapOrElseinstead. - [BREAKING] Remove the
option/Option.whenNonemethod. - [BREAKING] Remove the
option/Option.whenNoneSyncmethod. - [BREAKING] Remove the
option/Option.whenSomemethod. - [BREAKING] Remove the
option/Option.whenSomeSyncmethod. - [BREAKING] Rename the
option/Option.whereSyncmethod towhere. - [BREAKING] Rename the
option/Option.zipSyncmethod tozip. This new method no longer accepts a callback to generate the other value. - [BREAKING] Rename the
option/Option.zipWithSyncmethod tozipWith. This new method no longer accepts a callback to generate the other value. - [BREAKING] Remove the
option/Optionableextension. Use theOptionialextension instead. Instead of anasOptionmethod, this new extension has anoptionalgetter. - [BREAKING] Remove the
option/OptionalOptionextension. Use theFlattenedOptionextension instead. Instead of aflattenmethod, this new extension has aflattenedgetter. - [BREAKING] Remove the
option/OptionalResultextension. Use theTransposedOptionextension instead. Instead of atransposemethod, this new extension has atransposedgetter. - [BREAKING] Remove the
result/Checkertype. - [BREAKING] Remove the
result/ExceptionMappertype. - [BREAKING] Remove the
result/ExceptionMapperSynctype. - [BREAKING] Rename the
result/OkResultextension toSuccessfulResult. - [BREAKING] Rename the
result/ErrResultextension toErroneousResult. - [BREAKING] Rename the
result/Result.andSyncmethod toandThen. - [BREAKING] Remove the
result/Result.catchExceptionmethod. - [BREAKING] Remove the
result/Result.catchExceptionSyncmethod. - [BREAKING] Rename the
result/Result.collectSyncmethod tocollect. - [BREAKING] Rename the
result/Result.mapErrSyncmethod tomapErr. This new method no longer accepts a callback to calculate a fallback error. If a fallback error is desired, usemapErrOrormapErrOrElseinstead. - [BREAKING] Rename the
result/Result.mapSyncmethod tomap. This new method no longer accepts a callback to calculate a fallback value. If a fallback value is desired, usemapOrormapOrElseinstead. - [BREAKING] Remove the
result/Result.matchmethod. - [BREAKING] Remove the
result/Result.matchSyncmethod. - [BREAKING] Rename the
result/Result.orSyncmethod toorElse. - [BREAKING] Rename the
result/Result.unwrapErrSyncmethod tounwrapErr. This new method no longer accepts a callback to calculate a fallback error. If a fallback error is desired, useunwrapErrOrorunwrapErrOrElseinstead. - [BREAKING] Rename the
result/Result.unwrapSyncmethod tounwrap. This new method no longer accepts a callback to calculate a fallback value. If a fallback value is desired, useunwrapOrorunwrapOrElseinstead. - [BREAKING] Remove the
result/Result.whenErrmethod. - [BREAKING] Remove the
result/Result.whenErrSyncmethod. - [BREAKING] Remove the
result/Result.whenOkmethod. - [BREAKING] Remove the
result/Result.whenOkSyncmethod. - [BREAKING] Remove the
result/ResultingResultextension. Use theFlattenedResultextension instead. Instead of aflattenmethod, this new extension has aflattenedgetter. - [BREAKING] Remove the
result/ResultingOptionextension. Use theTransposedResultextension instead. Instead of atransposemethod, this new extension has atransposedgetter. - [BREAKING] Remove the
tuplelibrary. Dart comes with tuples built into the language now.
0.4.0 #
- Introduce asynchronous variants of functions where applicable.
- [BREAKING] Numerous functions that were previously synchronous in nature are now
asynchronous by default. Following Dart conventions, the synchronous variants have the suffix
Sync. Take extra care when upgrading so you don't end up with asynchronous functions that are never awaited.
0.3.0 #
- [BREAKING] Reduce maximum tuple item count to 8.
0.2.0 #
- [BREAKING] Migrate to null-safety. Requires Dart 2.12.
0.1.1 #
- Implement unit type.
0.1.0 #
- Implement tuples (up to 16 items).
- Implement optional values.
- Implement operation results.