News for hackers. Stuff that matters.
Re:Algebraic Effects – You Can Touch This (2019) by sigwinch28 on Wednesday December 14, 2022 @06:41AM (#33982245)
> Does using this construct allow me to put some things in the "that doesn't matter here" bin

I've been doing this year's Advent of Code in Unison (https://unison-lang.org/, no affiliation) and I've found the form of algebraic effects used there (Abilities in Unison parlence) great for "that doesn't matter here".

For example, the `Abort` ability allows me to stop control flow deep down inside my code at without having to "thread" a bunch of monads or Maybes or Eithers through all the intermediate layers.

In one case I also used the `Store` ability to accumulate some metadata about a simulation as it progressed without having to "pollute"[^1] all of the intermediate layers with explicit handling of the metadata.

[^1]: the abilities do appear in the type signatures, though.

https://www.unison-lang.org/learn/fundamentals/abilities/

https://share.unison-lang.org/@unison/p/code/latest/namespac...

There are no comments on this comment yet.