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);
50 var g = map(plus, [1,2,3]);
51 var is = map(\f->f(1), g);
53 //print("is.hd", is.hd);
55 print("f(4) = ", f(4));
57 print("faculty of 5 is: ", foldr(\x y->x*y, 1, intList(5)));
58 print("sum of 1..5 is: ", foldr(\x y->x+y, 0, intList(5)));
59 print("sum of 0..12 but only the evens: ",
60 foldr(\x y->x+y, 0, filter(\x->x%2 == 0, intList(12))));