I want to evaluate arguments to any function in parallel transparently (without any source level changes).
For example -
c = f(a, b)
should result in:
a
and b
being evaluated in parallel and then invoking of f
.
One way to do this is to convert the above expression to:
a' = future { a }
b' = future { b }
f' = lift f
(so that f: a -> b -> c
becomes f: Future<a> -> Future<b> -> Future<c>
)
so that c' = f'(a', b')
Is this possible to do in scala?