v0.3.0
- Inverted
onSomeandonNonefunctions parameters inmatchmethod ofOption[⚠️ BREAKING CHANGE] (Read more on why 👉 #56)
/// Everywhere you are using `Option.match` you must change this:
final match = option.match(
(a) => print('Some($a)'),
() => print('None'), // <- `None` second 👎
);
/// to this (invert parameters order):
final match = option.match(
() => print('None'), // <- `None` first 👍
(a) => print('Some($a)'),
);- Added
traverseandsequencemethods (#55)traverseListtraverseListWithIndexsequenceListtraverseListSeqtraverseListWithIndexSeqsequenceListSeq
/// "a40" is invalid 💥
final inputValues = ["10", "20", "30", "a40"];
/// Verify that all the values can be converted to [int] 🔐
///
/// If **any** of them is invalid, then the result is [None] 🙅♂️
final traverseOption = inputValues.traverseOption(
(a) => Option.tryCatch(
/// If `a` does not contain a valid integer literal a [FormatException] is thrown
() => int.parse(a),
),
);- Added
bindEithermethod inTaskEither(#58)
/// Chain [Either] to [TaskEither]
TaskEither<String, int> binding =
TaskEither<String, String>.of("String").bindEither(Either.of(20));- Added
lefts,rights, andpartitionEithersmethods toEither(#57)
final list = [
right<String, int>(1),
right<String, int>(2),
left<String, int>('a'),
left<String, int>('b'),
right<String, int>(3),
];
final result = Either.partitionEithers(list);
expect(result.first, ['a', 'b']);
expect(result.second, [1, 2, 3]);- Added
bimapmethod toEither,IOEither, andTuple2(#57) - Added
mapLeftmethod toIOEither(#57) - Added
foldmethod toOption(same asmatch) (#56) - Fixed
chainFirstforEither,TaskEither, andIOEitherwhen chaining on a failure (Left) (#47) by DevNico 🎉 - Added
constto all constructors in which it was missing (#59) - Minimum environment dart sdk to
2.17.0⚠️
environment:
sdk: ">=2.17.0 <3.0.0"-
Updated README and documentation
-
Testing improvements (internal)
- Added testing utils
- Added Property-based testing using
glados - Fixed tests for
match()method by addingfailin unexpected matched branch
-
Contribution improvements
- Added testing workflow with Github actions (#54)