summaryrefslogtreecommitdiff
path: root/docs/examples/monads/callccInterpreter.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2007-04-26 13:37:47 +0000
committerIulian Dragos <jaguarul@gmail.com>2007-04-26 13:37:47 +0000
commit8d2349581f5694704fb1bebc713339d46823ec67 (patch)
tree44be4d4b13a50c44a22e3310e9a2b24baa9cbf44 /docs/examples/monads/callccInterpreter.scala
parent99630e293745f07ac3e88582872230c015a4f963 (diff)
downloadscala-8d2349581f5694704fb1bebc713339d46823ec67.tar.gz
scala-8d2349581f5694704fb1bebc713339d46823ec67.tar.bz2
scala-8d2349581f5694704fb1bebc713339d46823ec67.zip
Updated examples wrt.
Diffstat (limited to 'docs/examples/monads/callccInterpreter.scala')
-rw-r--r--docs/examples/monads/callccInterpreter.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/examples/monads/callccInterpreter.scala b/docs/examples/monads/callccInterpreter.scala
index a0b16738c6..b184b4592e 100644
--- a/docs/examples/monads/callccInterpreter.scala
+++ b/docs/examples/monads/callccInterpreter.scala
@@ -58,14 +58,14 @@ object callccInterpreter {
def interp(t: Term, e: Environment): M[Value] = t match {
case Var(x) => lookup(x, e)
case Con(n) => unitM(Num(n))
- case Add(l, r) => for (val a <- interp(l, e);
- val b <- interp(r, e);
- val c <- add(a, b))
+ case Add(l, r) => for (a <- interp(l, e);
+ b <- interp(r, e);
+ c <- add(a, b))
yield c
case Lam(x, t) => unitM(Fun(a => interp(t, Pair(x, a) :: e)))
- case App(f, t) => for (val a <- interp(f, e);
- val b <- interp(t, e);
- val c <- apply(a, b))
+ case App(f, t) => for (a <- interp(f, e);
+ b <- interp(t, e);
+ c <- apply(a, b))
yield c
case Ccc(x, t) => callCC(k => interp(t, Pair(x, Fun(k)) :: e))
}