Can all code be represented as a series of Map / Filter / Reduce operations?

Posted by Mongus Pong on Programmers See other posts from Programmers or by Mongus Pong
Published on 2011-11-16T14:24:03Z Indexed on 2011/11/16 18:13 UTC
Read the original article Hit count: 186

Filed under:

I have recently been refactoring large chunks of code and replacing them with Linq queries.

Removing the language bias - Linq is essentially a set of Map / Filter and Reduce operations that operate on a sequence of data.

This got me thinking, how far would I theoretically be able to take this. Would I be able to rewrite the whole code base into a series (or even a single) of Map / Filter and Reduce operations.

Unfortunately I get paid to do useful stuff, so I haven't been able to experiment much further, but I can't think of any code structure that couldn't be re structured as such. Side effected code can be dealt with via monads.. Even output is essentially mapping memory addresses to screen addresses.

Is there anything that couldn't be (theoretically) rewritten as a Linq query?

© Programmers or respective owner

Related posts about computer-science