Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. (* lambda lifting がわからないという話 *)
  2.  
  3. let f x =
  4. let g y = x + y in
  5. g
  6.  
  7. (* ↓ λ lifting *)
  8.  
  9. let f x =
  10. let $g x y = x + y in
  11. $g x
  12.  
  13. (* ↓ 部分適用を解消 *)
  14.  
  15. let f x =
  16. let $g x y = x + y in
  17. let tmp y = $g x y in
  18. tmp
  19.  
  20. (* 戻った\(^o^)/ *)
  21.  
  22.  
  23. (*あるいは $g : int -> (int -> int) となるようにliftしても*)
  24.  
  25. let f x =
  26. let $g x =
  27. let tmp y = x + y in
  28. tmp in
  29. $g x
  30.  
  31. (* 戻った\(^o^)/ *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement