From: jim Date: Sat, 21 Mar 2015 12:58:36 +0000 (-0400) Subject: tweak X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=6ed932a8f76943fe19005e2daba4af260990d8d3;ds=sidebyside tweak --- diff --git a/exercises/assignment5_answers.mdwn b/exercises/assignment5_answers.mdwn index 9c30527e..b6d2dab9 100644 --- a/exercises/assignment5_answers.mdwn +++ b/exercises/assignment5_answers.mdwn @@ -768,4 +768,4 @@ and that `bool` is any boolean expression. Then we can try the following: match b with true -> y () | false -> n () - that would arguably still be relying on the special evaluation order properties of OCaml's native `match`. You'd be assuming that `n ()` wouldn't be evaluated in the computation that ends up selecting the other branch. That is correct, but to avoid making that assumption, you should instead first select the `y` or `n` result, _and then afterwards_ force the result. That's what we do in the above answer. + that would arguably still be relying on the special evaluation order properties of OCaml's native `match`. You'd be assuming that `n ()` wouldn't be evaluated in the computation that ends up selecting the other branch. Your assumption would be correct, but to avoid making that assumption, you should instead first select the `y` or `n` result, _and then afterwards_ force the result. That's what we do in the above answer.