From 8d2349581f5694704fb1bebc713339d46823ec67 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Thu, 26 Apr 2007 13:37:47 +0000 Subject: Updated examples wrt. --- docs/examples/monads/simpleInterpreter.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'docs/examples/monads/simpleInterpreter.scala') diff --git a/docs/examples/monads/simpleInterpreter.scala b/docs/examples/monads/simpleInterpreter.scala index d728c620cf..0707c40d06 100644 --- a/docs/examples/monads/simpleInterpreter.scala +++ b/docs/examples/monads/simpleInterpreter.scala @@ -50,14 +50,14 @@ object simpleInterpreter { 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 } -- cgit v1.2.3