Amb: Difference between revisions

Content added Content deleted
Line 1,047: Line 1,047:
unamb(join(join(join(w1, w2), w3), w4))</lang>
unamb(join(join(join(w1, w2), w3), w4))</lang>



===Comparison with Haskell===
;Comparison with Haskell:
This can be compared with the Haskell use of lists as a monad to represent choice.
This can be compared with the Haskell use of lists as a monad to represent choice.
* Haskell uses lazy evaluation; E does not. This implementation does not simulate lazy evaluation with thunks; it is eager (computes every intermediate choice before continuing) and therefore inefficient if you only need one successful result.
* Haskell uses lazy evaluation; E does not. This implementation does not simulate lazy evaluation with thunks; it is eager (computes every intermediate choice before continuing) and therefore inefficient if you only need one successful result.