You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forster, Kammar, Lindley and Pretnar compare the expressiveness of effects with different formulations in https://arxiv.org/abs/1610.09161, by defining rules for translating between each other. They note that translations from effect handlers into monads do not preserve well typedness in their type system.
Algebraic effects and handlers are very interesting to add to JS:
Unlike monads, they compose (so you don't need monad transformers and other hacks);
They have neat algebraic properties, as effects + operations form a specific algebra. Reasoning about effects is much simpler here, in particular when they compose;
Users can provide their own handlers, which is particularly great for e.g.: testing, but can also be used for adding modes to an application (e.g.: a trace mode where effects are recorded and a replay mode where the effects are replayed from a file). Without changing any code;
TypeScript doesn't have a very expressive type system, BUT we have some type-level operations and we can generate types, so it might be possible to try an approach like Scala's DOT to stack the effects;
Handlers require dynamic scoping, this should be possible to replicate with monadic bind (see Reader), but idk;
Would we want to rewrite Task in terms of Effect? And what would be the implications of that?
The text was updated successfully, but these errors were encountered:
@cyberglot mmh, is it published yet, and do you have a link/name for that paper? The ones linked in the Koka page don't have any coauthor or seem to involve monads from the abstract.
Forster, Kammar, Lindley and Pretnar compare the expressiveness of effects with different formulations in https://arxiv.org/abs/1610.09161, by defining rules for translating between each other. They note that translations from effect handlers into monads do not preserve well typedness in their type system.
If you're not familiar with algebraic effect handlers you should read Pretnar's tutorial: http://www.eff-lang.org/handlers-tutorial.pdf
Algebraic effects and handlers are very interesting to add to JS:
Possible problems:
The text was updated successfully, but these errors were encountered: