> But how important is having a fold well defined.  For many common
> numerical operations such as summing a list, taking the product of a
> list, etc. The order in which the elements get folded does not matter.
> All that matters is that each element gets represented exactly once.

>From an algebraic viewpoint, at least, it's very important, since fold is
_the_  operation over algebraic types and, computational concerns aside,
anything else which respects the abstraction can be defined in terms of it.
For example, in the programming language Charity fold is the only operation
on algebras. (There's a case operator too, but it's just a non-recursive
instance of fold.)

--FC



Reply via email to