New blog post: An effect notation based on with-clauses

https://blog.yoshuawuyts.com/a-with-based-effect-notation

This is my third attempt at defining a notation for a full-fledged effect system in Rust. It's taken some influence from Flix, Koka, and Effekt. As well as including a little sprinkling of Python, Swift, and Scala.

With some luck people will hate this design less than the last time I had a go at this.

An effect notation based on with-clauses and blocks

@yosh Reminder of my Swift-based suggestion from last time: putting the effect syntax before the return arrow, because it's things that happen before the function returns. Possibly more palatable if you consider "returns a T" as an effect itself.

@jrose I should really try that out!

FWIW the reason why I put it last is so that it would feel like it has some parity with where-clauses. And also Rust doesn't support return ascriptions on inline blocks. But maybe we should!

@jrose

Oh I also just realized: parsing ambiguity!

@yosh Yeah, if you want to use fn syntax. I don't really consider that new, though, you also have the existing ambiguity of with gen(Foo) -> &dyn Bar + Baz (is Baz an effect or another trait of the return value?). Especially since the most common generators need neither a resume nor a final result.