File: js_fun.ml.ref

package info (click to toggle)
ocamlformat 0.28.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,436 kB
  • sloc: ml: 63,321; pascal: 4,769; lisp: 229; sh: 217; makefile: 121
file content (32 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (2)
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
(* 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