<script> function fn(){ var i, rult = 0, len = arguments.length; for (i=0;i<len ;i++ ) { rult += arguments[i]; } return rult; } function addfn(fn){//Curry化函数,方法扩展性更强 var slice = [].slice,//存储方法 old_args = slice.call(arguments,1);//存储除fn外多余的参数 ret…
Data.Tuple fst :: (a,b) -> a fst (x,_) = x snd :: (a,b) -> b snd (_,y) = y curry :: ((a, b) -> c) -> a -> b -> c curry f x y = f (x, y) uncurry :: (a -> b -> c) -> ((a, b) -> c) uncurry f p = f (fst p) (snd p) swap :: (a,b) -…