Skip to content

I Fought The R And The R Won

Pre-release
Pre-release
Compare
Choose a tag to compare
@rzeigler rzeigler released this 25 Aug 18:15
· 40 commits to master since this release

With this release the API is now frozen baring any changes to fix defects.
The final 1.0.0 will be done once waveguide-stream, waveguide-node, and waveguide-browser are prototyped to ensure there is nothing obviously missing.
This release have a number of notable changes, chiefly, the run loop no longer manages R parameters. Attempting to make it do so was an exercise in frustration because typescript by default treats anything that is not a function input as covariant but we want the R to be contravariant.
As a simplified example that illustrates the problem

const oops: RIO<{}, never, string> = raiseAbort("will break anyway") as RIO<string, never, string>

As such, I have bifurcated the hierarchy into IO and RIO which is just a Reader on top of IO.
The Reader variant still has all the useful fiber and concurrency powers of IO however.

Other notable changes

  • IO renamed to Wave (since the whole API is changed anyway, we can differentiate on names)
  • RIO renamed to WaveR
  • Resource renamed to Managed (and loses it R parameters)
  • Managed renamed to ManagedR
  • Fiber now has a FiberR variant which is equivalent to the Fiber API but using {} as the R
  • Semaphore now has SemaphoreR which is equivalent to Semaphore but using {} as the R
  • console module now has logR variants in WaveR<R = {}, never, void>

v1.0.0-14...v1.0.0-rc.1