diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2007-04-26 13:37:47 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2007-04-26 13:37:47 +0000 |
commit | 8d2349581f5694704fb1bebc713339d46823ec67 (patch) | |
tree | 44be4d4b13a50c44a22e3310e9a2b24baa9cbf44 /docs/examples/monads/errorInterpreter.scala | |
parent | 99630e293745f07ac3e88582872230c015a4f963 (diff) | |
download | scala-8d2349581f5694704fb1bebc713339d46823ec67.tar.gz scala-8d2349581f5694704fb1bebc713339d46823ec67.tar.bz2 scala-8d2349581f5694704fb1bebc713339d46823ec67.zip |
Updated examples wrt.
Diffstat (limited to 'docs/examples/monads/errorInterpreter.scala')
-rw-r--r-- | docs/examples/monads/errorInterpreter.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/examples/monads/errorInterpreter.scala b/docs/examples/monads/errorInterpreter.scala index 4edb5caf88..536b7a152f 100644 --- a/docs/examples/monads/errorInterpreter.scala +++ b/docs/examples/monads/errorInterpreter.scala @@ -61,14 +61,14 @@ object errorInterpreter { 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 } |