rop 1.0.0 copy "rop: ^1.0.0" to clipboard
rop: ^1.0.0 copied to clipboard

ROP is a library designed to handle errors in a structured and fluent way using the Result<T> structure. Inspired by functional programming principles, it enables clear workflows that separate succ [...]

Changelog #

All notable changes to the ROP library will be documented in this file.

1.0.0 - 2024-12-23 #

Added #

  • Initial release of the ROP (Railway Oriented Programming) library 🎉

Core Features

  • Result<T> structure for representing operation outcomes
    • Result.success for successful operations
    • Result.failure for failed operations
    • Built-in properties: isSuccess, value, and errors

Extensions

  • Synchronous operations

    • bind for chaining dependent operations
    • map for value transformation
    • then for side effects on success
    • fallback for providing alternative results
    • combine for joining two successful results into a tuple
    • traverse for converting List<Result<T>> to Result<List<T>>
  • Asynchronous operations

    • bindAsync for asynchronous operation chaining
    • mapAsync for asynchronous value transformation
    • fallbackAsync for asynchronous fallback handling

Error Handling

  • RopError class with message property
  • Support for multiple error aggregation in Result.failure
  • Comprehensive error propagation in both sync and async workflows
1
likes
140
points
1
downloads

Publisher

verified publisherodmardaniel.com

Weekly Downloads

ROP is a library designed to handle errors in a structured and fluent way using the Result<T> structure. Inspired by functional programming principles, it enables clear workflows that separate success and error paths.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on rop