Effect-TS / effect

An ecosystem of tools for building production-grade applications in TypeScript.

Home Page:https://effect.website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support `this` argument for `{Either,Option}.gen()`?

ryota-ka opened this issue · comments

What is the problem this feature would solve?

Unlike Effect.gen(), {Either,Option}.gen() does not accept the this argument so that the this context is passed into the generator function.
This can be problematic when the function is used within a class with a method returning an Either/Option.

What is the feature you are proposing to solve the problem?

Add an ability to take the this argument to these functions.

What alternatives have you considered?

Aliasing this every time, like const self = this;.