
23 Jul
2010
23 Jul
'10
11:07 p.m.
On Fri, Jul 23, 2010 at 09:12:44PM -0500, aditya siram wrote:
Lists are non-deterministic, but the function taken by liftM2 does not necessarily generate all possible outcomes. In the case of (+) it does, not in the case of (-): liftM2 (-) [0,1] [2,3] => [0-1,0-2,1-2,1-3] => [-2,-3,-1,-2] if all possible cases were generated between the two lists we have to include also: [2-0,2-1,3-0,3-1]
If I have a - b where a and b are both non-deterministic, I wouldn't expect to also include in my solution set all the results of b - a. What if you have a / b? Would you try to include b / a, too, even though some values of a may be zero? Alex