Guest User

Untitled

a guest
Feb 11th, 2020
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # let is_string (_:string) = ();;
  2. val is_string : string -> unit = <fun>
  3. # is_string 3;;
  4. Error: This expression has type int but an expression was expected of type
  5. string
  6. # is_string "3";;
  7. - : unit = ()
  8. # module MyUsers = Map.Make(String);;
  9. ...
  10. # MyUsers.max_binding;;
  11. - : 'a MyUsers.t -> MyUsers.key * 'a = <fun>
  12. # let map = MyUsers.add "toto" 42 MyUsers.empty;;
  13. val map : int MyUsers.t = <abstr>
  14. # let (k, v) = MyUsers.max_binding map;;
  15. val k : MyUsers.key = "toto"
  16. val v : int = 42
  17. # is_string k;;
  18. - : unit = ()
Advertisement
Add Comment
Please, Sign In to add comment