编写一个高阶函数,atEach f xs
将默认函数f
应用于列表的每个元素xs
。
atEach succ [1 to 5] = [2,3,4,5,6]
atEach length ["Haskell", "go", "forward"] = [7,5,8]
编写一个高阶函数,atEach f xs
将默认函数f
应用于列表的每个元素xs
。
atEach succ [1 to 5] = [2,3,4,5,6]
atEach length ["Haskell", "go", "forward"] = [7,5,8]