Remix.run Logo
oisdk 8 hours ago

I would encourage anyone interested in this question to check out the paper "What is algebraic about algebraic effects and handlers?" (https://arxiv.org/abs/1807.05923) which is a write-up of the lecture series linked in the post above. I don't think the paper is too difficult to understand, but I know that if you're not familiar with the subject area it might be intimidating.

While I like the above blog post, I don't think that it will be very useful to people trying to understand algebraic effects. I see a lot of explainers like this one that shy away from some of the more gnarly-looking maths terms in an effort to appear more approachable, but as a result they can end up giving imprecise or vague definitions. When coupled with some subtle mistakes I think it can leave beginners more confused than helped (for instance, this author seems to conflate a few different notions of "composition", and they seem to think that the presence of equations makes an effect algebraic, which isn't really what the term "algebraic" is referring to in a technical sense).

The paper I linked above is not easy, and it would probably take at least a few hours to understand, but that's because it takes about that long to understand the material.

iamwil 6 hours ago | parent | next [-]

> they seem to think that the presence of equations makes an effect algebraic, which isn't really what the term "algebraic" is referring to in a technical sense

Author here! Open to learning. Can you expand on this? What is algebraic referring to in a technical sense?

oisdk 5 hours ago | parent [-]

Generally speaking, it means that the effect is derived from an algebraic theory (in a specific and structured way). While equations are definitely part of most theories, you can absolutely have a theory without equations, and furthermore you can define an effect with equations that isn't algebraic. The full definition of "algebraic theory" unfortunately doesn't really fit in a comment, but I did want to push back on the idea that "an effect becomes algebraic if you add equations to it".

In the effects literature, you often also see the definition that an operation (of an effect) is "algebraic" if the operation commutes with `>>=`. This definition is actually the same as the one above, just stated in a different way.

nyrikki 4 hours ago | parent [-]

Trying to be helpful here, sorry if it doesn’t map to your field of which I am not familiar.

The _algebra_ you learn in school is elementary algebra, using variables.

In modern math, _algebra_ or _modern_ algebra or _abstract_algebra, is the study of structures over sets with defined operations on the elements of that set.

ADTs are an example of an algebraic structure, specifically called one that converts non-trivial semantic (runtime) properties to trivial ones (T/F).

This post is dealing with the structure in another way.

If you understand magmas, monoids, etc.. that can be helpful.

But the lay description I find useful is the algebra is what _arises_ from that defined set domain and operations.

The key point is studying the structure, which is the algebraic structure, or the algebra. It is basically what pops out, not what you start with, although that is flawed.

Almost all modern math will use that _modern_ meaning of algebra.

iamwil 23 minutes ago | parent [-]

are you address me, or oisdk? I did mean algebra in terms of structure, and I tried to say that in the post.

sestep 6 hours ago | parent | prev [-]

Just to clarify, are you saying that you recommend that writeup over the lecture, or just linking the writeup for people who'd prefer it over watching a video?

oisdk 6 hours ago | parent [-]

I'm just recommending the writeup, but only because I haven't watched the lecture series myself (although I'm sure it's good, I've seen other lectures by the lecturer that were excellent). As far as I know, they cover basically the same material.