
8 Jun
2010
8 Jun
'10
8:43 a.m.
Hello The regular list functionals - map, zip, foldl, foldr, filter, etc. - all process the input list at "speed 1" - i.e. one element at a time. As Ozgur Akgun has shown - consuming the list at "speed 2" gives a very pleasant implementation - algorithmically: "consume at speed 2, produce the new list with the first element of the two and drop the second". Trying to code an algorithm at "speed 1" with the list functionals presents a significant hurdle towards clarity of exposition... Best wishes Stephen