4 ms·
Can you just use a callchain? function getData() { return processData(validateData(fetchDataFromSource())); }
by ww520 16y ago
Can you just use a callchain?
function getData() {
return processData(validateData(fetchDataFromSource()));
}
- jerf 16y agoIt's not quite equivalent due to differences in the semantics; a functional language can far more easily do loop fusion: http://en.wikipedia.org/wiki/Loop_fusion http://en.wikipedia.org/wiki/Loop_fusion . An imperative language is likely to not even try in that situation, or in the case of a good C compiler, end up failing to do the optimization at the slightest hint of pointer use. In Haskell it's robust and can be composed many times.