File: max_indent.ml

package info (click to toggle)
ocamlformat 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,820 kB
  • sloc: ml: 65,176; pascal: 4,877; lisp: 229; sh: 217; makefile: 121
file content (99 lines) | stat: -rw-r--r-- 2,840 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
let () =
  fooooo
  |> List.iter (fun x ->
       let x = x $ y in
       fooooooooooo x )

let () =
  fooooo
  |> List.iter
       (fun
         some_really_really_really_long_name_that_doesn't_fit_on_the_line ->
       let x =
         some_really_really_really_long_name_that_doesn't_fit_on_the_line $ y
       in
       fooooooooooo x )

let () =
  List.iter
    (fun
      some_really_really_really_long_name_that_doesn't_fit_on_the_line ->
    let x =
      some_really_really_really_long_name_that_doesn't_fit_on_the_line $ y
    in
    fooooooooooo x )

let foooooooooo =
  foooooooooooooooooooooo
  |> Option.bind ~f:(function
       | Pform.Expansion.Var (Values l) -> Some (static l)
       | Macro (Ocaml_config, s) ->
         Some (static (expand_ocaml_config (Lazy.force ocaml_config) var s))
       | Macro (Env, s) -> Option.map ~f:static (expand_env t var s) )

let fooooooooooooo =
  match lbls with
  | (_, {lbl_all}, _) :: _ ->
    let t =
      Array.map
        (fun lbl -> (mknoloc (Longident.Lident "?temp?"), lbl, omega))
        lbl_all
    in
    fooooooo

let foooooooooo =
  match fooooooooooooo with
  | Pexp_construct
      ({txt= Lident "::"; _}, Some {pexp_desc= Pexp_tuple [_; e2]; _}) ->
    if is_sugared_list e2 then Some (Semi, Non)
    else Some (ColonColon, if exp == e2 then Right else Left)

let foooooooooooooooooooooooooo =
  match foooooooooooooooooooooo with
  | Pexp_apply
      ( { pexp_desc=
            Pexp_ident
              {txt= Lident (("~-" | "~-." | "~+" | "~+.") as op); loc}
        ; pexp_loc
        ; pexp_attributes= []
        ; _ }
      , [(Nolabel, e1)] ) ->
    fooooooooooooooooooooooooooooooooooooo

let fooooooooooooooooooooooooooooooooooo =
  match foooooooooooooooooooooo with
  | ( Ppat_constraint
        ( ({ppat_desc= Ppat_var _; _} as p0)
        , {ptyp_desc= Ptyp_poly ([], t0); _} )
    , Pexp_constraint (e0, t1) )
    when Poly.(t0 = t1) ->
    m.value_binding m

let foooooooooooooooooooooooooooooooo =
  match foooooooooooooooooooooooooooo with
  | Tpat_variant (lab, Some omega, _) -> (
    fun q rem ->
      match q.pat_desc with
      | Tpat_variant (lab', Some arg, _) when lab = lab' -> (p, arg :: rem)
      | Tpat_any -> (p, omega :: rem)
      | _ -> raise NoMatch )

let x =
  some_fun________________________________
    some_arg______________________________ (fun param ->
    do_something () ; do_something_else () ; return_this_value )

let x =
  some_fun________________________________
    some_arg______________________________ ~f:(fun param ->
    do_something () ; do_something_else () ; return_this_value )

let x =
  some_value
  |> some_fun (fun x ->
       do_something () ; do_something_else () ; return_this_value )

let x =
  some_value
  ^ some_fun (fun x ->
      do_something () ; do_something_else () ; return_this_value )