X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=exercises%2Fassignment5_answers.mdwn;h=b6d2dab9d07f93c31adfd85c5c4d9cbaa66795a3;hp=9c30527e9d64a7789cb7e20114c2ac833581c277;hb=6ed932a8f76943fe19005e2daba4af260990d8d3;hpb=2a7b99413dbcdb336e57c222f79e2ce85ddbb9f8 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.