(* Additional functions from CSE341 lecture 8, Sp11, 4/13/11 *)
fun dbl_each(lst: int list) =
case lst of
[] => []
| x::xs => (2*x)::dbl_each(xs)
fun inc_each(lst) =
case lst of
[] => []
| x::xs => (x+1)::inc_each(xs)
fun map_each(f, lst) =
case lst of
[] => []
| x::xs => f(x)::map_each(f, xs)
fun dbl(x) = 2*x;
fun inc(x) = x+1;
fun hi(x) = "hello";
val sqr = fn x => x*x;
map_each(dbl, [1,2,3,4]);
map_each(fn x => x*3, [1,2,3,4]);