-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How will the effect interact with the ecosystem of TypeScript? #13
Comments
maybe this:
|
nowadays, an exception in typescript is enforced to type any. this makes us can't have checked exception features. This should not happen again in the algebra effect. The function should be implicitly colored by the algebra effect |
Following this approach we could have something like that:
or
or
It'll not avoid
|
Aren’t MS folks the exact people who came up with the effect language Koka? They certainly have an idea about how, so the question is more about whether they will do it. On the typing end, it certainly helps to add type-checking to perform/throw, possibly using new keywords like There is, however, no real motivation for error type checking, at least to the extent of polyfilling done by TS since it never needs to be polyfilled. Effects will need polyfilling, so TS has an interest in knowing what causes what and stops what. (As a part of the possibly wild world, we need a Proxy-like for run time type checking too. We can rethrow with |
I think just So it could be something like this:
|
@Artoria2e5 I asked TS guys about that (I think, even before you asked). I was told TS and RiSE teams never communicated, and it's for some reason hard for them to do so. |
Typing effects in TS isn't going to be hard due to implementation, but it won't be easy either for other reason . Functions get annotated with yet another place for a type:
Typechecker computes intersection type of effects for every call site inside of a function. For example,
Now
|
@polkovnikov-ph Trying to get my head around this, why does |
No description provided.
The text was updated successfully, but these errors were encountered: