While searching the Internet for "algebraic effect systems" I fould this beautiful language called "Koka", and got curious. They have a nice book that, believe or not, references the D programming language here: https://koka-lang.github.io/koka/doc/book.html#sec-with