1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
(* preferred list style *)
let z = f [y; foo ~f:(fun () -> arg)]
let z = f [y; foo ~f:(fun () -> arg)]
(* legacy list style *)
let _ = [f (fun x -> x); f (fun x -> x); f (fun x -> x)]
let _ = [f (fun x -> x); f (fun x -> x); f (fun x -> x)]
let _ = [f (fun x -> x); f (fun x -> x); f (fun x -> x)]
let _ =
x
>>= fun x ->
(try x with _ -> ()) >>= fun x -> try x with _ -> () >>= fun x -> x
let () = expr >>| function x -> 3 | y -> 4
let () = expr >>| fun z -> match z with x -> 3 | y -> 4
let () = expr >>| fun z -> function x -> 3 | y -> 4
let () = my_func () >>= function A -> 0 | B -> 0
let () = my_func () >>= function A -> 0 | B -> 0
let () = expr >>| function x -> 3 | y -> 4
let () = expr >>| function x -> 3 | y -> 4
let f =
f >>= m (fun f -> fun x -> y) ;
z
let f =
f |> m (fun f -> fun x -> y) ;
z
let f =
f |> m (fun f -> fun x -> y) ;
z
|