Skip to content

Commit aa7ea43

Browse files
committed
Apply fmt changes
1 parent e2049a0 commit aa7ea43

2 files changed

Lines changed: 24 additions & 33 deletions

File tree

src/provider.mli

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ module Trait : sig
4646
defined by a module type with a single type t. For example:
4747
4848
{[
49-
module type Show = sig
50-
type t
49+
module type Show = sig
50+
type t
5151
52-
val show : t -> string
53-
end
52+
val show : t -> string
53+
end
5454
55-
module Show : sig
56-
val t : ('a, (module Show with type t = 'a), [> `Show ]) Provider.Trait.t
57-
end = Provider.Trait.Create (struct
58-
type 'a module_type = (module Show with type t = 'a)
59-
end)
55+
module Show : sig
56+
val t : ('a, (module Show with type t = 'a), [> `Show ]) Provider.Trait.t
57+
end = Provider.Trait.Create (struct
58+
type 'a module_type = (module Show with type t = 'a)
59+
end)
6060
]}
6161
6262
The other functors are reserved for less common cases. The number suffix
@@ -191,13 +191,13 @@ val implement : ('t, 'module_type, _) Trait.t -> impl:'module_type -> 't Binding
191191
tests for this library, we have two modules defining each their own tag:
192192
193193
{[
194-
module Directory_reader = struct
195-
type tag = [ `Directory_reader ]
196-
end
194+
module Directory_reader = struct
195+
type tag = [ `Directory_reader ]
196+
end
197197
198-
module File_reader = struct
199-
type tag = [ `File_reader ]
200-
end
198+
module File_reader = struct
199+
type tag = [ `File_reader ]
200+
end
201201
]}
202202
203203
Then, the type of a provider whose internal type is [state], implementing

test/test__trait0.ml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ let same_trait t1 t2 =
1414
;;
1515

1616
let%expect_test "Create" =
17-
let module T1 =
18-
Provider.Trait.Create (struct
17+
let module T1 = Provider.Trait.Create (struct
1918
type 'a module_type = (module T with type t = 'a)
2019
end)
2120
in
22-
let module T2 =
23-
Provider.Trait.Create (struct
21+
let module T2 = Provider.Trait.Create (struct
2422
type 'a module_type = (module T with type t = 'a)
2523
end)
2624
in
@@ -30,14 +28,12 @@ let%expect_test "Create" =
3028
;;
3129

3230
let%expect_test "Create0" =
33-
let module T1 =
34-
Provider.Trait.Create0 (struct
31+
let module T1 = Provider.Trait.Create0 (struct
3532
type _ t = unit
3633
type module_type = unit
3734
end)
3835
in
39-
let module T2 =
40-
Provider.Trait.Create0 (struct
36+
let module T2 = Provider.Trait.Create0 (struct
4137
type _ t = unit
4238
type module_type = unit
4339
end)
@@ -48,14 +44,12 @@ let%expect_test "Create0" =
4844
;;
4945

5046
let%expect_test "Create1" =
51-
let module T1 =
52-
Provider.Trait.Create1 (struct
47+
let module T1 = Provider.Trait.Create1 (struct
5348
type ('a, _) t = 'a
5449
type 'a module_type = unit
5550
end)
5651
in
57-
let module T2 =
58-
Provider.Trait.Create1 (struct
52+
let module T2 = Provider.Trait.Create1 (struct
5953
type ('a, _) t = 'a
6054
type 'a module_type = unit
6155
end)
@@ -66,14 +60,12 @@ let%expect_test "Create1" =
6660
;;
6761

6862
let%expect_test "Create2" =
69-
let module T1 =
70-
Provider.Trait.Create2 (struct
63+
let module T1 = Provider.Trait.Create2 (struct
7164
type ('a, 'b, _) t = 'a * 'b
7265
type ('a, 'b) module_type = unit
7366
end)
7467
in
75-
let module T2 =
76-
Provider.Trait.Create2 (struct
68+
let module T2 = Provider.Trait.Create2 (struct
7769
type ('a, 'b, _) t = 'a * 'b
7870
type ('a, 'b) module_type = unit
7971
end)
@@ -121,8 +113,7 @@ let%expect_test "Marshal" =
121113
they as it relates to marshalling traits.
122114
123115
In short: do not marshall traits. *)
124-
let module T =
125-
Provider.Trait.Create (struct
116+
let module T = Provider.Trait.Create (struct
126117
type 'a module_type = (module T with type t = 'a)
127118
end)
128119
in

0 commit comments

Comments
 (0)