Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. let rec tup_maker value = (value, value, value) in
  2. let rec make_adder x =
  3. let rec adder y = x + y in
  4. adder in
  5. let rec apply_tup tup =
  6. let (f, a, b) = tup in
  7. f a b in
  8. let x = 7 in
  9. let rec whoisbest tup =
  10. let (f, g, a) = tup in
  11. let c1 = (f, a, x) in
  12. let c2 = (g, a, x) in
  13. if (apply_tup c1 < apply_tup c2)
  14. then (
  15. 1
  16. ) else (
  17. 2
  18. ) in
  19. let rec add_x y = x + y in
  20. let rec useless f a = f in
  21. let tup = tup_maker 4 in
  22. let tuptup = tup_maker tup in
  23. let (t1, t2, t3) = tuptup in
  24. let (a, b, c) = t1 in
  25. let z = b + 3 in
  26. let arg = (make_adder, useless add_x, z) in
  27. print_int( whoisbest arg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement