Skip to content

Commit e844fd9

Browse files
fpdart v0.3.0 (#61)
2 parents 4d37130 + a7f3106 commit e844fd9

27 files changed

+387
-733
lines changed

CHANGELOG.md

+77-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,81 @@
1-
# v0.2.1 - Soon
1+
# v0.3.0 - 11 October 2022
2+
- Inverted `onSome` and `onNone` functions parameters in `match` method of `Option` [⚠️ **BREAKING CHANGE**] (*Read more on why* 👉 [#56](https://github.com/SandroMaglione/fpdart/pull/56))
3+
```dart
4+
/// Everywhere you are using `Option.match` you must change this:
5+
final match = option.match(
6+
(a) => print('Some($a)'),
7+
() => print('None'), // <- `None` second 👎
8+
);
9+
10+
/// to this (invert parameters order):
11+
final match = option.match(
12+
() => print('None'), // <- `None` first 👍
13+
(a) => print('Some($a)'),
14+
);
15+
```
16+
- Added `traverse` and `sequence` methods ([#55](https://github.com/SandroMaglione/fpdart/pull/55))
17+
- `traverseList`
18+
- `traverseListWithIndex`
19+
- `sequenceList`
20+
- `traverseListSeq`
21+
- `traverseListWithIndexSeq`
22+
- `sequenceListSeq`
23+
```dart
24+
/// "a40" is invalid 💥
25+
final inputValues = ["10", "20", "30", "a40"];
26+
27+
/// Verify that all the values can be converted to [int] 🔐
28+
///
29+
/// If **any** of them is invalid, then the result is [None] 🙅‍♂️
30+
final traverseOption = inputValues.traverseOption(
31+
(a) => Option.tryCatch(
32+
/// If `a` does not contain a valid integer literal a [FormatException] is thrown
33+
() => int.parse(a),
34+
),
35+
);
36+
```
37+
- Added `bindEither` method in `TaskEither` ([#58](https://github.com/SandroMaglione/fpdart/pull/58))
38+
```dart
39+
/// Chain [Either] to [TaskEither]
40+
TaskEither<String, int> binding =
41+
TaskEither<String, String>.of("String").bindEither(Either.of(20));
42+
```
43+
- Added `lefts`, `rights`, and `partitionEithers` methods to `Either` ([#57](https://github.com/SandroMaglione/fpdart/pull/57))
44+
```dart
45+
final list = [
46+
right<String, int>(1),
47+
right<String, int>(2),
48+
left<String, int>('a'),
49+
left<String, int>('b'),
50+
right<String, int>(3),
51+
];
52+
final result = Either.partitionEithers(list);
53+
expect(result.first, ['a', 'b']);
54+
expect(result.second, [1, 2, 3]);
55+
```
56+
- Added `bimap` method to `Either`, `IOEither`, and `Tuple2` ([#57](https://github.com/SandroMaglione/fpdart/pull/57))
57+
- Added `mapLeft` method to `IOEither` ([#57](https://github.com/SandroMaglione/fpdart/pull/57))
58+
- Added `fold` method to `Option` (same as `match`) ([#56](https://github.com/SandroMaglione/fpdart/pull/56))
259
- Fixed `chainFirst` for `Either`, `TaskEither`, and `IOEither` when chaining on a failure (`Left`) ([#47](https://github.com/SandroMaglione/fpdart/pull/47)) by [DevNico](https://github.com/DevNico) 🎉
3-
- Fixed tests for `match()` method by adding `fail` in unexpected matched branch
60+
- Added `const` to all constructors in which it was missing ([#59](https://github.com/SandroMaglione/fpdart/issues/59))
61+
- Minimum environment dart sdk to `2.17.0` ⚠️
62+
```yaml
63+
environment:
64+
sdk: ">=2.17.0 <3.0.0"
65+
```
66+
- Updated [README](README.md) and documentation
67+
- **New tutorial articles**
68+
- [How to make API requests with validation in fpdart](https://www.sandromaglione.com/techblog/fpdart-api-request-with-validation-functional-programming)
69+
- [How to use TaskEither in fpdart](https://www.sandromaglione.com/techblog/how-to-use-task-either-fpdart-functional-programming)
70+
- [Collection of tutorials on fpdart](https://www.sandromaglione.com/course/fpdart-functional-programming-dart-and-flutter)
71+
72+
- Testing improvements (*internal*)
73+
- Added testing [utils](test/src/utils/utils.dart)
74+
- Added Property-based testing using [`glados`](https://pub.dev/packages/glados)
75+
- [Fixed tests](https://github.com/SandroMaglione/fpdart/pull/47#issuecomment-1215319237) for `match()` method by adding `fail` in unexpected matched branch
76+
77+
- Contribution improvements
78+
- Added [testing workflow](.github/workflows/test.yml) with Github actions ([#54](https://github.com/SandroMaglione/fpdart/pull/54))
479

580
# v0.2.0 - 16 July 2022
681
- Refactoring for [mixin breaking change](https://github.com/dart-lang/sdk/issues/48167) ([#42](https://github.com/SandroMaglione/fpdart/pull/42)) by [TimWhiting](https://github.com/TimWhiting) 🎉

0 commit comments

Comments
 (0)