Guest User

Untitled

a guest
Feb 21st, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.35 KB | None | 0 0
  1. let foobar msg x =
  2.   printfn msg;
  3.   x
  4.  
  5. let () =
  6.   let ex1 = foobar in
  7.   let ex2 = foobar "called" in
  8.   let ex3 x = foobar "called" x in
  9.  
  10.   assert (ex1 "called" 1 = 1);
  11.   assert (ex1 "called" "hi" = "hi");    (* OK *)
  12.  
  13.   assert (ex2 1 = 1);
  14.   assert (ex2 "hi" = "hi"); (* Error! *)
  15.  
  16.   assert (ex3 1 = 1);
  17.   assert (ex3 "hi" = "hi"); (* OK *)
Advertisement
Add Comment
Please, Sign In to add comment