File: module.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 (127 lines) | stat: -rw-r--r-- 2,067 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module AAAAAAAAAAAAAAAAAAA =
  Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod

let _ =
  let module A = B in
  let module AAAAAAAAAAAAAAAAAAA =
    Soooooooooooooooooooooooome.Loooooooooooooooooooooooong.Mod
  in
  t

let create (type a b) t i w p =
  let module T = (val (t : (a, b) t)) in
  T.create i w p

module C = struct
  module rec A : sig
    type t

    module rec B : sig
      type t

      type z
    end

    and A : B
  end =
    A

  and B : sig end = B
end

module O : sig
  type t
end
with type t := t = struct
  let () = ()
end

module O : sig
  type t
end
with type t := t
 and type s := s = struct
  let () = ()
end

include struct
  (* a *)
end

include A (struct
  (* a *)
end)

let x : (module S) = (module struct end)

let x = (module struct end : S)

module rec A : (sig
  type t
end
with type t = int) = struct
  type t = int
end

module A (_ : S) = struct end

module A : functor (_ : S) -> S' = functor (_ : S) -> struct end

let helper ?x =
  match x with Some (module X : X_typ) -> X.f | None -> X_add_one.f

let helper ?x:((module X) = (module X_add_one : X_typ)) = X.f

module GZ : functor (X : sig end) () (Z : sig end) -> sig end =
  (val Mooooooooooooooooooo)

module GZZZZZZZZZZZZZZ : functor (X : sig end) () (Z : sig end) -> sig end =
  _

module M = struct end

module M = F ()
module M = F (* xxx *) ( (* xxx *) ) (* xxx *)

module M = F (struct end)

module M = F (G) ()
module M = F (G) ( (* xxx *) )

module M = F (G) (struct end)

module M =
  F
    (struct
      val x : t

      val y : t
    end)
    ( (* struct type z = K.y end *) )

let _ =
  let module M =
    (val (* aa *) m (* bb *) : (* cc *) M (* dd *) :> (* ee *) N (* ff *))
  in
  let module M =
    ( val m
        : M with type t = k and type p = k
        :> N with type t = t and type k = t )
  in
  let module M =
    ( val (* aa *) m (* bb *)
        : (* cc *)
        M with type t = t (* dd *)
        :> (* ee *)
        N with type t = t (* ff *) )
  in
  ()

module M =
  [%demo
  module Foo = Bar

  type t]

module M = F (A : T)