Skip to content

Latest commit

 

History

History
81 lines (66 loc) · 2.78 KB

todo.md

File metadata and controls

81 lines (66 loc) · 2.78 KB

Core

  • add tests (property-based tests for monad laws?)
  • change then method to flatMap
  • support async
  • catch method
  • correct type restrictions on errors
  • sequence and parallel functions
  • race function
  • finally method
  • catchAll method for unsoundly throw errors

Async, Concurrency & Fault Tolerance

  • wait function e.g. .andThen(IO.wait(5, "seconds"))
  • timeout method (implement in terms of IO.race?)
  • retry method
  • exponential backoff for retry
  • filter for retry

Cancellation & Fibers

  • Add Canceled to IOOutcome
  • Add cancellation behaviour to run loop
  • Add a way to interoperate with other cancellation mechanisms e.g. clearTimeout
  • Support async cancel callbacks for IO.cancelable
  • Fiber.start function
  • Fiber.cancel method
  • Fiber.outcome method
  • Rewrite parallel using fibers
  • Rewrite race using fibers
  • IO.cancel function for a fiber to self-cancel
  • IO.onCancel method for resource cleanup
  • Add IO.bracket function for resource cleanup
  • Add a way to create uncancelable sections

Data Structures

  • Ref
  • Tests for Ref
  • Deferred?
  • Queue?
  • Batcher?
  • FiberPool - for limiting concurrency. Build on top of Queue?

Performance & Internals

  • make recursive IO stack-safe
  • optimise to avoid creation of unnecessary promises
  • write some useful benchmarks - compare async/await/throw implementation to IO
  • Re-use the Wrap, Raise and Cancel class as the cases of IOResult to avoid allocations?

Code Organisation

  • work out how to split into several modules
  • replace IOInterface and methods object with abstract base class
  • Use consistent terminology throughout - e.g. IO vs action vs effect
  • Rename IOResult to Outcome or IOOutcome and IOOutcome to OutcomeKind
  • Refactor IO implementation to take executeOn as a private member rather than using inheritance.
  • Make type errors easier to understand by removing the massive union type.
  • Remove duplication between implementations of IO.race and IO.parallel.

Ergonomics Improvements

  • lift function to return IO
  • map method
  • mapError method
  • forEach method (and parallel equivalent)
  • .as method
  • repeatForever method
  • some more helper methods for composing independent IOs and returning the first or second value
  • overload andThen to take an IO instead of a () => IO
  • Support for partial functions in catch and andThen?

Documentation and Release

  • Set up documentation generator.
  • Publish docs to GitHub pages.
  • Add "Getting Started" guide to the readme.
  • Ensure all important methods and functions have doc comments.
  • Publish to NPM.