<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: oisdk</title><link>https://news.ycombinator.com/user?id=oisdk</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 13 Jun 2026 02:15:10 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=oisdk" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by oisdk in "Algebraic Effects for the Rest of Us"]]></title><description><![CDATA[
<p>It’s pretty annoying to comment “this thing was already present in CL 30 years ago”, then to have someone correct you (pointing out that this is a common misconception, and algebraic effects are not equivalent to conditions at all), and then to respond not to admit you’re wrong but instead to say “algebraic effects are bad anyway because you shouldn’t want one of the extra features they give you (nondeterminism)”.<p>By the way, nondeterminism is not the only difference between the two.</p>
]]></description><pubDate>Sat, 30 May 2026 10:40:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=48334768</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=48334768</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48334768</guid></item><item><title><![CDATA[New comment by oisdk in "Single-Pass Huffman Coding"]]></title><description><![CDATA[
<p>There's no (practical) advantage to the circular implementation; it's just a curiosity.<p>It is useful for understanding laziness and some interesting theoretical tools for traversing data structures, though. For a more in-depth look at the idea of circular programs for traversal, Bird's paper (linked in the post, <a href="https://link.springer.com/article/10.1007/BF00264249" rel="nofollow">https://link.springer.com/article/10.1007/BF00264249</a>) is a good start.</p>
]]></description><pubDate>Wed, 24 Dec 2025 10:23:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=46374280</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=46374280</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46374280</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>I'm afraid I don't think I'm making progress here.<p>My overall point was that I felt your original comment was a little confused about algebraic effects. You seemed to think that the "algebra" in "algebraic effects" didn't refer to algebraic operations on normal values, which is incorrect. The basic middle-school algebra of a ring (+, *, etc., with all of the normal laws) does indeed give rise to an algebraic effect, and code that uses that effect can just be normal code like `x = 2 * y`. The "effect" here is the "ring" effect.<p>However, I don't think that this discussion is that productive. If you want to understand algebraic effects, unfortunately there is no substitute for just reading through the fundamental literature (like the paper I linked). I would love to be able to give you a short, easy-to-understand example that explains all the ideas in a few lines, but the concept just isn't that simple.<p>I see this a lot on this forum in particular: people like to develop a vague intuition for something rather than really understanding the concept properly, but almost always their "intuition" is very inaccurate, and they understand the thing less well than they think they do. Then, they try and teach others the concept, and <i>those</i> learners are even more misled.<p>----------------------------------------------------------------------<p>I will try and point out some misconceptions in your last comment here, but again I will caution that I don't think you will be able to fully understand the topic just by reading these comments.<p>> So, with algebraic effects, I would expect that this is about the ways that effects can be combined using basic algebra tools.<p>I understand, but that is not what algebraic effects is about.<p>The "algebra" in algebraic effects doesn't refer to an algebra for combining effects, it refers to algebras like monoid etc., and you get an effect for any particular algebra.<p>> In effects, I'd expect that you are combining whatever it is an effect is.<p>This is incorrect. First, there are algebras that have no "combining" at all, and second, the algebras involved are just the normal algebras you're already familiar with, like the boolean algebra etc.<p>> You seem to be saying that an effect is a standard value? But, that seems at odds with the definitions that distinguish "pure" functions from those that have "effects" being defined by things that they cause to happen.<p>Yes, an effect is a standard value. And yes, we often want to distinguish pure functions from effectful ones.
(By the way, this does not mean that effectful functions are somehow not standard values)<p>However, in an algebraic effect the algebra does not combine effects.<p>> It isn't enough to say "writes to stderr", we want to know that it does so without clobbering someone else currently writing to the same spot.<p>I mean, obviously if the write is going to be performed concurrently you'll need more guarantees.<p>I included one law that might be important, but you could easily add more. That doesn't change the core concept.<p>> So, when asking for an example, I'm hunting for something to meet me somewhere in the middle. Sucks that this commonly comes down to "writes to a logger."<p>I'm not sure what you mean by the "middle"—middle between what two extremes? I picked the writing to a logger example because it was simple, and showed a simple law. The key-value store in the post is a little more complex, and involves a few more laws. In the paper there's even more examples: I/O etc. You have a lot of examples available to you!</p>
]]></description><pubDate>Tue, 23 Sep 2025 10:40:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=45345203</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45345203</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45345203</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>> that's my understanding of why these things are called 'algebraic' effects.<p>This is a misconception. Algebraic effects are not algebraic because they come from algebraic data types, the two features are completely independent (you can have algebraic effects without algebraic data types and vice versa).<p>> It's not that ConsoleOutput and ConsoleInput (however you define that using + or *) are magically 'composable' just because they're both algebraic... for that composition you need extra rules (however you specify that) because effects don't (in general) compose.<p>Actually, if you have two algebraic effects they <i>can</i> automatically compose. And this <i>is</i> a consequence of them both being algebraic. It's just that an algebraic effect is unrelated to an algebraic data type.</p>
]]></description><pubDate>Tue, 23 Sep 2025 09:56:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=45344899</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45344899</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45344899</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>Well, I gave the example of a logging effect above. In the post there’s also an example of a key-value store effect. What’s missing from these examples exactly?<p>All of these effects have simple operations (get and put for store, the `write` operation for the logging effect, etc.) These are all normal operations in your language: they just return values, like normal, and the laws that govern them are equivalent to the laws of any other algebra.<p>Elsewhere you mentioned Boolean algebra, and that people shouldn’t confuse that with algebraic effects: Boolean algebra can absolutely be another example of an algebraic effect! The operations are the Boolean operations (call them whatever you like, + or * or whatever), and the laws are the usual laws.<p>The point of algebraic effects is in noticing that traditional effects (logging, state, exceptions) can be thought of as algebraic the same way as Boolean algebras or monoids.<p>If you’re looking for an implementation, there are lots of implementations available in Haskell and other languages. However, to understand those you’d really already have to have a good understanding of the topic first, and then you’d also need to be comfortable with Haskell syntax (and probably free monads as well). I think that the paper really gives the best introduction to the topic, unfortunately there’s no way to simplify it much further.</p>
]]></description><pubDate>Mon, 22 Sep 2025 21:39:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=45339846</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45339846</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45339846</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>For an algebra, you have some operations and some equations. The group algebra has the + operation, and 0 and -, and all the relevant equations.<p>You can also form an algebra from logging. One operation might be “write to stdout”. And then a law might be `write x; write y = write (x ++ y)` where ++ is string concatenation.<p>This is the algebra, the algebra isn’t for combining effects at all. (Yes, you can combine algebraic effects, and the fact that they’re algebraic does help, but that’s for technical reasons that aren’t relevant)<p>The paper I linked in another comment has a good overview of the topic. It’s really not the kind of thing you can understand from reading a few comments, and the paper is well-written and goes over all of the main points from a pretty basic starting point.</p>
]]></description><pubDate>Mon, 22 Sep 2025 20:34:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=45339088</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45339088</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45339088</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>I mean, the program snippet that I gave above contains 3 first-class values. If you write `x = y + z + 0`, or any other statement that uses the group algebra (or any other algebra), you can use algebraic effects to describe the semantics. The “first-class values” here are the x, y, and z: there’s nothing fancy going on. You can even use the group laws to show that the statement is equivalent to `x = y + z` (or whatever). It’s just normal, value-level algebra.</p>
]]></description><pubDate>Mon, 22 Sep 2025 19:26:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=45338282</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45338282</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45338282</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>> I'd assume "algebraic effects" are to talk about performing algebra on the effects. That is, you are specifically going to talk about how different things combine effects<p>This is a misconception. The "algebra" does not refer to an algebra of effects, or combining effects in any way.<p>It's more like it's the other way around: "algebraic effects" are effects generated from algebras. These algebras are precisely-defined mathematical objects (like groups, monoids, etc.), so you have an "effect" that corresponds to monoids, an "effect" that corresponds to groups, and so on.<p>> My point is simply that there is no value in the program that says an effect has or has not completed. This is why I compare it to stepping through the program. The "line of code" that is active in executing code is not a first class value in your program.<p>I know: I'm trying to say that the "algebra" of "algebraic effects" <i>do</i> refer to first-class values. The + and * from other algebraic operations are the algebraic operations you might use for an algebraic effect.</p>
]]></description><pubDate>Mon, 22 Sep 2025 18:08:12 +0000</pubDate><link>https://news.ycombinator.com/item?id=45337265</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45337265</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45337265</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>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".<p>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.</p>
]]></description><pubDate>Mon, 22 Sep 2025 17:50:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=45336993</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45336993</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45336993</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>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.</p>
]]></description><pubDate>Mon, 22 Sep 2025 17:39:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=45336850</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45336850</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45336850</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>> For one, if algebraic isn't aiming at the ideas in an algebra, then they absolutely should be using a different name.<p>Algebraic effects are certainly algebraic, they're just not directly related to algebraic data types. Both ideas are using "algebraic" at different levels, and I think trying to understand algebraic effects by referencing algebraic data types will be more confusing than helpful.<p>> My point is that the "value" is not the written value of a variable in ways that people are used to working with in their program.<p>I'm saying that (in algebraic effects) the "value" in question is precisely a normal variable that people are used to working with in programming languages. It is <i>not</i> a type-level value, which is the kind of value in question when we're talking about algebraic data types.<p>For example, if we take Groups (the algebra referenced in the post), we have a binary operation (that we might call +) along with a few other operations. We could write a piece of code like the following:<p><pre><code>    x = y + z
</code></pre>
The "group" in question here could absolutely be an algebraic effect. And the line of code above could be implemented using algebraic effects, and interpreted using an algebraic effect handler. You don't even need types, if you didn't want them.<p>> For two, though, the whole idea is how to compose the "value" of different effects together?<p>No, not really.<p>Yes, algebraic effects compose well. But so do other effects systems and abstractions (applicatives, etc.). The fact that the effects compose is not what makes them algebraic, it's a consequence of it.<p>I don't think I can give a proper explanation in a comment, but I would point you to the paper I linked in another comment (<a href="https://arxiv.org/abs/1807.05923" rel="nofollow">https://arxiv.org/abs/1807.05923</a>).</p>
]]></description><pubDate>Mon, 22 Sep 2025 17:36:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=45336825</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45336825</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45336825</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>The "algebraic" in "algebraic effects" is not really related to algebraic data types, or sum or product types. I mean, I suppose they're related, since they both refer to algebra in the general sense, but there's no type-level algebra in a description of algebraic effects. (and, I suppose, you could do some type-level algebra with effects, like taking the "sum" of two effects, but again that's not what the "algebra" in "algebraic effects" is referring to)<p>> The big underline, though, is getting people to realize what algebra there is is not on the values that your code represents.<p>This is not correct. In the case of algebraic effects, the algebra is absolutely value-level.</p>
]]></description><pubDate>Mon, 22 Sep 2025 16:39:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=45335913</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45335913</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45335913</guid></item><item><title><![CDATA[New comment by oisdk in "What is algebraic about algebraic effects?"]]></title><description><![CDATA[
<p>I would encourage anyone interested in this question to check out the paper "What is algebraic about algebraic effects and handlers?" (<a href="https://arxiv.org/abs/1807.05923" rel="nofollow">https://arxiv.org/abs/1807.05923</a>) which is a write-up of the lecture series linked in the post above. I don't think the paper is <i>too</i> difficult to understand, but I know that if you're not familiar with the subject area it might be intimidating.<p>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).<p>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.</p>
]]></description><pubDate>Mon, 22 Sep 2025 15:32:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=45334860</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=45334860</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45334860</guid></item><item><title><![CDATA[New comment by oisdk in "F*: A proof oriented general purpose programming language"]]></title><description><![CDATA[
<p>> F* is a programming language with proof support. Lean/Coq are theorem providers that can be used to model and generate code.<p>Lean is also a programming language with proof support. It is very much in the same category as F* in this regard, and not in the same category as Coq (Rocq).</p>
]]></description><pubDate>Thu, 26 Dec 2024 12:32:58 +0000</pubDate><link>https://news.ycombinator.com/item?id=42514812</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=42514812</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=42514812</guid></item><item><title><![CDATA[New comment by oisdk in "Six-hour time-restricted feeding inhibits lung cancer progression"]]></title><description><![CDATA[
<p>No there are not. There are studies in mice (like this one), studies in vitro, etc.<p>> There's limited interest in it though because most of those things simply have no profit potential<p>This is not true. There is a lot of interest in the Keto diet, it has been well-studied and has uses in treating epilepsy. The reason it's not prescribed more generally is <i>because</i> of those studies, which show <i>it doesn't work</i>. Not everything is a conspiracy.</p>
]]></description><pubDate>Sun, 05 Nov 2023 13:41:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=38151028</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=38151028</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38151028</guid></item><item><title><![CDATA[New comment by oisdk in "Six-hour time-restricted feeding inhibits lung cancer progression"]]></title><description><![CDATA[
<p>> if you ever read the cases of people being harmed by their doctors advice and getting healed by going opposite to their doctors advice you would never have said such a thing.<p>There are countless cases of shoddy care from doctors. The existence of crappy doctors does not mean keto is effective.<p>> Modern medicine is NOT patient focused: it's pharma focused.<p>Again, the existence of bad incentives in medicine/corruption is not evidence of keto working.<p>> And who do you think sponsors most of those "medicine journal" studies?<p>There are serious, good-faith criticisms of modern medicine to be made. Blindly saying it's all nonsense, and instead you should do a juice cleanse with keto instead of chemo, is not a serious good-faith criticism.<p>> if thousands of people healed their diseases which the "modern medicine" completely fails to heal using the keto diet<p>This has not happened. Keto has not healed thousands of peoples' cancer. There is no evidence (and I mean real evidence, not a youtube video or podcast recounting an anecdote) of keto being effective at curing cancer.</p>
]]></description><pubDate>Sun, 05 Nov 2023 13:36:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=38151003</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=38151003</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38151003</guid></item><item><title><![CDATA[New comment by oisdk in "Six-hour time-restricted feeding inhibits lung cancer progression"]]></title><description><![CDATA[
<p>> do note that youtube is heavily censoring low carb stuff since "it's not mainstream approved" lol<p>By "not mainstream approved" you mean it's largely discredited and confined to quacks and charlatans online. Outside of its one legitimate use—very specific cases of epilepsy—no serious medical organisation endorses keto for the general population or cancer patients.<p>The third video you link is of a person who thinks that they cured their cancer with, among other things, juicing, breathwork, "positive mindset", and keto. This is nonsense.<p>> despite people healing conditions on it that no modern medicine could<p>If it worked, it would <i>become</i> "modern medicine". The reason it's not accepted in the mainstream is that it has failed every basic test of efficacy. The reason that you will find it promoted primarily on youtube and not in major medical journals is that the youtube audience is less well-equipped to spot it as snake-oil.</p>
]]></description><pubDate>Sun, 05 Nov 2023 13:18:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=38150880</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=38150880</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38150880</guid></item><item><title><![CDATA[New comment by oisdk in "Monads Schmonads: Functional Input Without Tears (PYFL)"]]></title><description><![CDATA[
<p>[The original paper which introduced Monads to Haskell](<a href="https://www.microsoft.com/en-us/research/wp-content/uploads/1993/01/imperative.pdf" rel="nofollow">https://www.microsoft.com/en-us/research/wp-content/uploads/...</a>) is a fantastic read, and extremely easy to understand. It explains clearly why monads are a good option, and what problem they're meant to solve in Haskell.<p>In the article itself, the line:<p>> As it happens the computation will need the value of b before that of a. If this is a problem, we can write the definition of  root1 as<p>Is actually quite interesting: the problem being described there is almost <i>identical</i> to one of the problems that Haskell had with I/O, which motivated the introduction of monads.</p>
]]></description><pubDate>Sun, 23 May 2021 22:29:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=27259235</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=27259235</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27259235</guid></item><item><title><![CDATA[New comment by oisdk in "That Dothraki Horde, Part III: Horse Fiddles"]]></title><description><![CDATA[
<p>Game of Thrones is medieval fantasy, and as the second-biggest medieval fantasy series of all time it will have a significant impact on people's perception of the medieval time period.<p>I think that claim is pretty uncontroversial, which is why I didn't provide "evidence" for it, and also I get the sense that I'd be wasting my time in arguing with you about it when you throw out silly pedantries like "oh well dorne is based on palestine".</p>
]]></description><pubDate>Sun, 20 Dec 2020 23:16:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=25490519</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=25490519</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=25490519</guid></item><item><title><![CDATA[New comment by oisdk in "That Dothraki Horde, Part III: Horse Fiddles"]]></title><description><![CDATA[
<p>> extremely elastic view of “like medieval Europe”.<p>No. Westeros is based on medieval Europe, culturally, politically, and historically. Obviously it's fiction, well done on spotting that, but it's a fictionalised version <i>of medieval Europe</i>.<p>> Undeniably? Based on...what evidence?<p>I'm sorry, do I have to provide you with evidence that media impacts people's perception of things?</p>
]]></description><pubDate>Sun, 20 Dec 2020 18:28:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=25488373</link><dc:creator>oisdk</dc:creator><comments>https://news.ycombinator.com/item?id=25488373</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=25488373</guid></item></channel></rss>