News for hackers. Stuff that matters.
Re:Algebraic Effects for the Rest of Us by dgudkov on Wednesday July 24, 2019 @07:11AM (#20513967)
I, like many people in this thread, learnt about algebraic effects for the first time from the posted article. However, many commenters seem to be mislead by the explanation based on an example with exceptions. What I learnt from [1] linked below is that algebraic effects is a generalization of which language constructs like try/catch, async/await, or generators are just particular cases.

From that perspective, algebraic effects make sense and look very interesting.

[1] https://github.com/ocamllabs/ocaml-effects-tutorial

Re:Algebraic Effects for the Rest of Us by danabramov on Wednesday July 24, 2019 @01:39PM (#20517588)
I tried to address this in the article but I guess people skipped over this?

>Note, however, that algebraic effects are much more flexible than try / catch, and recoverable errors are just one of many possible use cases. I started with it only because I found it easiest to wrap my mind around it.

Re:Algebraic Effects for the Rest of Us by kazinator on Wednesday July 24, 2019 @07:39PM (#20521234)
Algebraic effects are synchronous; they can't be a generalization of async anything, because that uses threads.

A generalization has to do everything that the specialization does, like dispatch on multiple processors.

The synchronous version of async/await is delay/force; that is just macrology over some lambdas.

Re:Algebraic Effects for the Rest of Us by dgudkov on Saturday July 27, 2019 @02:49AM (#20540747)
Not all implementations of async are thread-based. For instance, in C# it's task-based. In F# it's thread-based.