dart_either
Either monad for Dart language and Flutter framework. Type-safe error handling, railway oriented programming. Supports Monad comprehensions, async map, async flatMap.
2.1.0
29K downloads/mo
#1869 most downloaded on pub.dev
hoc081098/dart_either
What this package is like to depend on
Last release 5 months ago
07 Mar 2026
Ships fairly regularly
a new release about every 1.4 years
Nearly every release is documented
notes for 4 of 4 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
10 releases · first in 2021
1 release in the last 12 months
see the full history below
Release timeline
10 releases · Apr 2021 to Mar 2026Releases
latest 10-
2.1.007 Mar 2026Release notes
Open source →https://pub.dev/packages/dart_either/versions/2.1.0
- Promoted
Either.parSequenceNandEither.parTraverseNfrom experimental to stable. - Added complete API docs and examples for
Either.parSequenceNandEither.parTraverseN. - Added unit tests for
Either.parSequenceNandEither.parTraverseN, including concurrency-limit and short-circuit cases. - Added
@useResultannotations to public APIs that should not be ignored (for example:isLeft,isRight,map,flatMap,swap,exists,all,toEitherStream,left,right, and others).
API migration notes
Either.parSequenceNchanged from positional parameters to named parameters:// Before (2.0.0) Either.parSequenceN<String, int>(functions, n); // Now (2.1.0) Either.parSequenceN<String, int>( functions: functions, maxConcurrent: n, );
Either.parTraverseNchanged from positional parameters to named parameters:// Before (2.0.0) Either.parTraverseN<String, int, int>(values, mapper, n); // Now (2.1.0) Either.parTraverseN<String, int, int>( values: values, mapper: mapper, maxConcurrent: n, );
maxConcurrentcontrols concurrency.- Pass a number (for example
2) to limit concurrency. - Pass
nullfor unlimited concurrency.
- Pass a number (for example
Release notes
Open source →- Promoted
Either.parSequenceNandEither.parTraverseNfrom experimental to stable. - Added complete API docs and examples for
Either.parSequenceNandEither.parTraverseN. - Added unit tests for
Either.parSequenceNandEither.parTraverseN, including concurrency-limit and short-circuit cases. - Added
@useResultannotations to public APIs that should not be ignored (for example:isLeft,isRight,map,flatMap,swap,exists,all,toEitherStream,left,right, and others).
API migration notes
Either.parSequenceNchanged from positional parameters to named parameters:// Before (2.0.0) Either.parSequenceN<String, int>(functions, n); // Now (2.1.0) Either.parSequenceN<String, int>( functions: functions, maxConcurrent: n, );Either.parTraverseNchanged from positional parameters to named parameters:// Before (2.0.0) Either.parTraverseN<String, int, int>(values, mapper, n); // Now (2.1.0) Either.parTraverseN<String, int, int>( values: values, mapper: mapper, maxConcurrent: n, );maxConcurrentcontrols concurrency.- Pass a number (for example
2) to limit concurrency. - Pass
nullfor unlimited concurrency.
- Pass a number (for example
- Promoted
-
2.0.001 Sep 2024Release notes
Open source →https://pub.dev/packages/dart_either/versions/2.0.0
-
Require Dart 3.0.0 or higher
>=3.0.0 <4.0.0. -
Make
Eithera sealed class,EitherEffecta sealed class, andControlErrora final class.
Now you can use exhaustive switch expressions onEitherinstances.final Either<String, int> either = Either.right(10); // Use the `when` method to handle either.when( ifLeft: (l) => print('Left: $l'), ifRight: (r) => print('Right: $r'), ); // Prints Right: Either.Right(10) // Or use Dart 3.0 switch expression syntax 🤘 print( switch (either) { Left() => 'Left: $either', Right() => 'Right: $either', }, ); // Prints Right: Either.Right(10)
What's Changed
- chore(deps): update codecov/codecov-action action to v3.1.1 by @renovate in #11
- chore(deps): update dart-lang/setup-dart action to v1.4 by @renovate in #12
- chore(deps): update codecov/codecov-action action to v3.1.2 by @renovate in #13
- chore(deps): update codecov/codecov-action action to v3.1.6 by @renovate in #14
- fix(deps): update dependency http to v1 - autoclosed by @renovate in #15
- chore(deps): update actions/checkout action to v4 by @renovate in #17
- chore(deps): update codecov/codecov-action action to v4 by @renovate in #19
- dart 3.0.0, switch expression, sealed class by @hoc081098 in #23
Full Changelog: 1.0.0...2.0.0
Release notes
Open source →-
Require Dart 3.0.0 or higher
>=3.0.0 <4.0.0. -
Make
Eithera sealed class,EitherEffecta sealed class, andControlErrora final class. Now you can use exhaustive switch expressions onEitherinstances.final Either<String, int> either = Either.right(10); // Use the `when` method to handle either.when( ifLeft: (l) => print('Left: $l'), ifRight: (r) => print('Right: $r'), ); // Prints Right: Either.Right(10) // Or use Dart 3.0 switch expression syntax 🤘 print( switch (either) { Left() => 'Left: $either', Right() => 'Right: $either', }, ); // Prints Right: Either.Right(10)
-
-
1.0.023 Aug 2022Release notes
Open source →https://pub.dev/packages/dart_either/versions/1.0.0
- This is our first stable release.
Full Changelog: 0.0.1...1.0.0
-
1.0.0-beta0623 Aug 2022 pre-release -
1.0.0-beta0523 Aug 2022 pre-release -
1.0.0-beta0421 Aug 2022 pre-releaseRelease notes
Open source → -
1.0.0-beta0317 Aug 2022 pre-release -
1.0.0-beta0216 Aug 2022 pre-release -
1.0.0-beta0115 Aug 2022 pre-release -
0.0.127 Apr 2021