light_result 0.1.2 copy "light_result: ^0.1.2" to clipboard
light_result: ^0.1.2 copied to clipboard

A lightweight, zero-dependency functional error handling package for Dart 3. Built with sealed classes and pattern matching.

0.1.2 #

  • Docs: Rewrote README with motivation section and real-world comparisons.
  • Docs: Rewrote example with 6 practical scenarios (login, API, validation, cache, Option, async chaining).

0.1.1 #

  • Fix: LICENSE file now uses standard MIT format recognized by pub.dev.
  • Fix: Resolved unintended_html_in_doc_comment warning in TaskResult docs.
  • Added Unit type for void-returning Result operations.
  • Added Either<L, R> type alias for fpdart/dartz migration.

0.1.0 #

  • Initial release.
  • Result<L, R> sealed class with Left and Right subclasses.
  • Option<T> sealed class with Some and None subclasses.
  • Full pattern matching support with exhaustive checking.
  • Functional chaining: map, mapLeft, flatMap, fold, getOrElse, tap, tapLeft, swap, filter.
  • Result.guard() and Result.guardAsync() for safe exception wrapping.
  • Result.combine() and Result.waitAll() for combining multiple results.
  • TaskResult and TaskOption extensions for async chaining without intermediate await.
  • Type aliases: ResultOf, StringResult, AppResult, AsyncResult, AsyncResultOf.
  • Failure base class for typed error hierarchies.
  • Test matchers: isRight, isLeft, isRightWith, isLeftWith, isSome, isNone, isSomeWith.
1
likes
0
points
247
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight, zero-dependency functional error handling package for Dart 3. Built with sealed classes and pattern matching.

Repository (GitHub)
View/report issues

Topics

#functional-programming #error-handling #result-type #either #monad

License

unknown (license)

Dependencies

matcher

More

Packages that depend on light_result