u/alleung

Wrote a library & accompanying article enabling cleaner Effect code

A few things were annoying me with how Effect code is written so I wrote some utilities to improve the experience. For anyone who writes Effect code I'd appreciate some feedback on the library and article if you have some time. I have some feedback for the Effect maintainers regarding how Effect should evolve.

TL;DR: rather than writing

const someEffect: Effect<void, SomeError> = Effect.gen(function*() {
  ...
});

write this

function* someEffect(): Effect.fn.Return<void, SomeError> {
 ...
}

you'll get more targeted error messages from the compiler.

alexleung.net
u/alleung — 6 days ago