2 hours ago · Tech · 0 comments

In my last post I described what an effect notation might look like using with-clauses and blocks. When discussing effects over dinner with lcnr a couple of days ago they asked a really good question that I’ll paraphrase here: “Why are effects the right answer? What do they provide that extensions to the trait system cannot?” The answer to ”Why effects?” is not one of capabilities. It is true that a sufficiently powerful trait system could probably encode everything an effect system could. The answer however is one of accessibility: something being technically possible isn’t worth much if the amount of effort needed to achieve it puts it out of reach for a lot of people. I think of “effects” as actually being three distinct features in a trench coat, which by being exposed via a unified interface create a pleasant and accessible experience. Those features are: Implicit arguments: also known as “capabilities”, “dependency injection”, and “contexts”. This allows us to write signatures…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.