G'day all.

Quoting Chris Kuklewicz <[EMAIL PROTECTED]>:

> The compiler may not deforest that list, so creating the list may be a small
> overhead of this method.

And in return, you get:

    - Code that is smaller than the imperative version, AND
    - a reusable function, making the next incarnation of
      an algorithm like this even shorter.

For most interesting cases, the cost of f and goOn will surely dominate
anyway.

> Note that "f x" should be "f a" above.

Yes, you're right.  I abstracted out "f" after testing and before
posting.

Cheers,
Andrew Bromage
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to