fun mapUsingListFunctions(f, ls) = if null ls then [] else f(hd ls)::mapUsingListFunctions(f, tl ls) val test = mapUsingListFunctions( (fn x => x * x), [1, 2, 3]) (* val test = [1,4,9] : int list *)