Skip to content
No description, website, or topics provided.
Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
project Scala interpretation of “Effects without Monads” Oct 20, 2019
src/main/scala/effects Actually optimize code generated by `powerCode` Nov 1, 2019
.gitignore Scala interpretation of “Effects without Monads” Oct 20, 2019
LICENSE
README.md yep Oct 21, 2019
build.sbt Scala interpretation of “Effects without Monads” Oct 20, 2019

README.md

Based on the following article from Oleg Kiselyov: Effects Without Monads: Non-determinism — Back to the Meta Language. See also http://okmij.org/ftp/tagless-final/nondet-effect.html


The paper does not really present a novel way to deal with effects, but uses this problem as a starting point to discuss how to apply embedded DSLs to this problem. It claims that the monadic interface is not only useless but even harmful because supporting it reduces the space of possible effect interpreters. This is illustrated with two particular interpreters: performing a static analysis of expressions without evaluating them (abstract interpretation), and generating (possibly more efficient) code from expressions.


The paper uses MetaOCaml to implement these ideas. My goal was to see how this code would translate to idiomatic Scala 3 code, using enums, parameterized traits, extension methods, and staging (for run-time code generation).

The project is written as a single literate program.

You can’t perform that action at this time.