Advertisement
xavierm02

Untitled

Sep 14th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.32 KB | None | 0 0
  1. (* version qui met une erreur *)
  2. let apply f x = f x;;
  3. let identity = apply (fun t -> t);;
  4. identity 1;;
  5. identity true;;(* Error: This expression has type bool but an expression was expected of type int *)
  6.  
  7. (* version qui marche *)
  8. let apply f x = f x;;
  9. let identity x = apply (fun t -> t) x;;
  10. identity 1;;
  11. identity true;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement