Everybody knows now that linear data are bad for performance. But in Java everything is based on Iterable, with the idea, deeply rooted in math, that we can only visit the content of X if we iterate over it (enumerable sets etc), that is, have an epimorphism from N to that X.
Well, that's stupid. All we need is foundation axiom to hold.
In plain words, a tree is good as well, but a tree can be scanned in parallel.
But programmers of the world were trained to write a loop every time they see a plurality of something.
But the loop does not actually mean it should be interpreted sequentially.
If you write
for (x <- container) {
}
it only means that the job is done inside a monad.
That's why you should think monad, eh. That's why enumerables are XX century. Foundation axiom is way more powerful.
I actually can even prove it, but only for a Boolean base topos.
(oneof the sources)
When I find something interesting and new, I post it here - that's mostly programming, of course, not everything.
Tuesday, July 20, 2010
Subscribe to:
Posts (Atom)