Scala Days 2012 was held in London in April. I presented a paper “Stackless Scala with Free Monads” at the conference. You can read it here: http://blog.higher-order.com/assets/trampolines.pdf
Scala Days 2012 was held in London in April. I presented a paper “Stackless Scala with Free Monads” at the conference. You can read it here: http://blog.higher-order.com/assets/trampolines.pdf
Hi Rúnar, very much enjoyed reading this paper. Couple of questions:
1. Would it be possible, using a State monad, to implement a Cucumber-like BDD framework, such that each GIVEN/WHEN/THEN step returns a State, which in turn is passed as an input to each subsequent step, thereby eliminating the mutation of common state in test steps?
2. Would this be desirable, for example in the Play 2.0 / TypeSafe stack?
3. Has anyone done this yet in scala?
Thanks,
-Marc
Yeah, that would be totally doable. In fact, you can generalize that solution to an IO monad which is just
Free[({type f[x] = Either[I => x, (O, x)})]
whereI
is the type of input signals andO
is the type of output signals. What you describe is just a generalization of that monad.I don’t think anyone has done exactly what you describe, but I’ve sketched out e.g. client/server program (a REPL for a simple language) where
O
is executable javascript andI
is AJAX requests. The client (running in a browser) can then be seen as a machine that turns Os into Is.Runar
Hi Rúnar, the link seems to be dead, and my google fu didn’t help. Could you please upload the paper somewhere?
Thanks Daniel, I have updated the link to a more permanent place (Github).
Thank you!