5 return f(l.hd) : map(f, l.tl);
13 return foldr(f, f(acc, l.hd), l.tl);
22 return filter(f, l.tl);
24 return l.hd : filter(f, l.tl);
33 return x : intList(x-1);
52 var g = map(plus, [1,2,3]);
53 var is = map(\f->f(1), g);
55 //print("is.hd", is.hd);
57 print("f(4) = ", f(4));
59 print("faculty of 5 is: ", foldr(\x y->x*y, 1, intList(5)));
60 print("sum of 1..5 is: ", foldr(\x y->x+y, 0, intList(5)));
61 print("sum of 0..12 but only the evens: ",
62 foldr(\x y->x+y, 0, filter(\x->x%2 == 0, intList(12))));