fabrik_result 1.1.0
fabrik_result: ^1.1.0 copied to clipboard
A lightweight toolkit for functional-style types like Either, built for clarity and real-world use.
Changelog #
All notable changes to this package are documented in this file.
The format is based on Keep a Changelog, and this project adheres to semantic versioning.
1.1.0 #
A purely additive release. Nothing was removed or renamed, so upgrading from 1.0.x requires no code changes.
Either #
- New:
map— transform the success value, leaving aLeftuntouched - New:
mapLeft— transform the failure value, leaving aRightuntouched - New:
flatMap/flatMapAsync— chain fallible operations without nestingfoldcalls - New:
getOrElse— read the success value with a fallback for the failure case - New:
swap— exchange theLeftandRightsides - New:
Either.tryCatch/Either.tryCatchAsync— run throwing code and capture the exception as aLeft, replacing hand-written try/catch at API and parsing boundaries
Option #
- New:
Option.fromNullable/toNullable— bridge betweenOptionand Dart's nullable types, useful when reading JSON and other loosely typed data - New:
map,flatMap,getOrElse,where— the same ergonomics asEither - New:
toEither— convert a missing value into a typed failure
Tooling #
- Switched dev dependencies from
flutter_testtopackage:testand fromflutter_lintstolints— the package is pure Dart and can now be developed and tested with the Dart SDK alone, no Flutter install required - Tests now import the public
package:fabrik_result/fabrik_result.dartrather than reaching intosrc/ - Test suite grown from 24 to 80 tests
1.0.1 #
- Fix: Added
==andhashCodetoLeft,Right,Some, andNone— value equality was broken (right(42) == right(42)previously returnedfalse) - Fix: Removed Flutter as a runtime dependency —
fabrik_resultis pure Dart and now works in any Dart project, not just Flutter apps - Added equality test coverage for all four types
1.0.0 #
This is a major, stabilizing release that defines the long-term scope and philosophy of fabrik_result.
The package has been refined to provide a minimal, explicit, and predictable result-handling toolkit for Dart and Flutter applications, without introducing unnecessary functional abstractions.
Added #
Either<L, R>for explicit success and failure modelingLeftandRightsealed variantsfoldfor exhaustive handling- Convenience helpers for common access patterns:
onRightonLeftrightOrNullleftOrNull
Option<T>for modeling presence or absence of a valueSomeandNonesealed variantsfold,isSome, andisNone- Factory helpers
some()andnone()
Unittype as a typed replacement forvoid- Singleton
unitinstance for ergonomic usage
- Singleton
- Comprehensive documentation and examples
- Full test coverage for all core types
0.1.1 #
- Fixed repository URL
- Minor documentation corrections
0.1.0 #
- Initial public release
- Introduced
Either<L, R>withLeft,Right, andfold - Introduced
Unitas a typed alternative tovoid