Can someone kindly explain to me why the following
def map(s: Set, f: Int => Int): Set = x => exists(s, y => f(y) == x)
not equivalent
def map(s: Set, f: Int => Int): Set = x => exists(s, f(x))
where "exists" is a function that returns whether there is a limited integer inside s (first argument) satisfying p (second argument).
Why do you need to specify "y => f (y) == x"? Thanks a million!
source share