File: record.ml

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 (92 lines) | stat: -rw-r--r-- 1,784 bytes parent folder | download
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
type t = {x: int; y: int}

let _ = {x= 1; y= 2}

let _ = {!e with a; b= c}

let _ = {!(f e) with a; b= c}

let _ =
  { !looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
    with
    a
  ; b= c }

let _ =
  { !looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
    with
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
  ; b= c }

let _ = {(a : t) with a; b; c}

let _ = {(f a) with a; b; c}

let _ = {(a ; a) with a; b; c}

let _ = {(if x then e else e) with e1; e2}

let _ = {(match x with x -> e) with e1; e2}

let _ = {(x : x) with e1; e2}

let _ = {(x :> x) with e1; e2}

let _ = {(x#x) with e1; e2}

let f ~l:{f; g} = e

let f ?l:({f; g}) = e

let _ = {a; b = ((match b with `A -> A | `B -> B | `C -> C) : c); c}

let a () = A {A.a = (a : t)}

let x =
  { aaaaaaaaaa
  (* b *); b}

let x =
  { aaaaaaaaaa
  (* b *)
  ; b}

type t = { a : (module S); b : (module S) }

let _ = { a = (module M : S); b = (module M : S) }

let to_string {x; _ (* we should print y *)} = string_of_int x

let { x = (x : t) } = x

type t =
  { xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : YYYYYYYYYYYYYYYYYYYYY.t
    (* ____________________________________ *)
  }

let _ =
  let _ = function
    | {
      foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo;
      foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo;
    } ->
        ()
  in
  ()

let foo
    ({
       foooooooooooooooooooooo;
       invalidation_trace;
       access_trace;
       must_be_valid_reason;
     } [@warning "+missing-record-field-pattern"]) =
  ()

let x = (A(B)).a

let x = A(B).a

let x = (1).a

type 'a t = A : 'b. {a: 'a} -> 'a t