Is "speed x" at least a somewhat universal term for the number of list elements that get operated on per iteration? It works really well.<br><br>I was also wondering about what you just pointed out: if there's a nice way to form (what I now know to call) speed >1 functions. Your form looks a lot nicer than some of the stranger things I've been coming up with.<br>
<br><div class="gmail_quote">On Thu, Jan 12, 2012 at 1:37 AM, Stephen Tetley <span dir="ltr"><<a href="mailto:stephen.tetley@gmail.com">stephen.tetley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Direct recursion is almost always clearer if you are traversing the<br>
list at a "different speed". The usual list functionals (map, filter,<br>
folds) are all speed 1 - traversing one element at a time. Here we<br>
want pairwise traversal:<br>
<br>
unscan :: (a -> a -> b) -> [a] -> [b]<br>
unscan f (a:b:bs) = f a b : unscan f b bs<br>
unscan _ _ = []<br></blockquote></div>