[Haskell-beginners] Average of numeric list
dav.vire+haskell at gmail.com
Tue Apr 5 10:58:36 CEST 2011
2011/4/4 Daniel Fischer <daniel.is.fischer at googlemail.com>
> Note however, that that's not a particularly efficient way to calculate the
> mean, since the compiler isn't smart enough to transform it into a loop
> traversing the list once (so allowing it to be garbage collected as it is
> consumed and the computation to run in constant space) and keeping the
> accumulators evaluated.
I've always wondered, is it imaginable that a compiler would be able to do
such transforms (assuming very intelligent people (i.e. not me) have plenty
of time to work on it), or is it way too complicated ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners