正在加载图片...
Higher-order functions Given function f,return function fo f 入f.2x.f(fx) ·How does this work? (2f.x.f(fx)(y.y+1)5 =(x.(y.y+1)(y.y+1)X)5 =(2x.(2y.y+1)(+1)5 =(2x.(x+1)+1)5 =5+1+1=7Higher-order functions • Given function f, return function f ∘ f f. x. f (f x) • How does this work? (f. x. f (f x)) (y. y+1) 5 = (x. (y. y+1) ((y. y+1) x)) 5 = (x. (y. y+1) (x+1)) 5 = (x. (x+1)+1) 5 = 5+1+1 = 7
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有