Skip to content

Commit 0abaad8

Browse files
committed
Upgrade ocamlformat to 0.27.0
1 parent 84d5428 commit 0abaad8

32 files changed

+833
-890
lines changed

.ocamlformat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
profile = default
2-
version = 0.26.2
2+
version = 0.27.0
33

44
exp-grouping=preserve

lib/picos.domain/picos_domain.mli

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ val at_exit : (unit -> unit) -> unit
66
(** [at_exit action] registers [action] to be called when the current domain
77
exits.
88
9-
On OCaml 5 this calls {!Domain.at_exit}. On OCaml 4 this calls
9+
On OCaml 5 this calls {!Domain.at_exit}. On OCaml 4 this calls
1010
{!Stdlib.at_exit}. *)
1111

1212
val recommended_domain_count : unit -> int
1313
(** [recommended_domain_count ()] returns [1] on OCaml 4 and calls
14-
{!Domain.recommended_domain_count} on OCaml 5. *)
14+
{!Domain.recommended_domain_count} on OCaml 5. *)
1515

1616
val is_main_domain : unit -> bool
1717
(** [is_main_domain ()] returns [true] on OCaml 4 and calls
@@ -23,14 +23,14 @@ module DLS : sig
2323
ℹ️ On OCaml 4 there is always only a single domain. *)
2424

2525
type 'a key
26-
(** Represents a key for storing values of type ['a] in storage associated with
27-
domains. *)
26+
(** Represents a key for storing values of type ['a] in storage associated
27+
with domains. *)
2828

2929
val new_key : (unit -> 'a) -> 'a key
3030
(** [new_key compute] allocates a new key for associating values in storage
31-
associated with domains. The initial value for each domain is [compute]d
31+
associated with domains. The initial value for each domain is [compute]d
3232
by calling the given function if the [key] is {{!get} read} before it has
33-
been {{!set} written}. The [compute] function might be called multiple
33+
been {{!set} written}. The [compute] function might be called multiple
3434
times per domain, but only one result will be used. *)
3535

3636
val get : 'a key -> 'a

lib/picos.thread/picos_thread.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module TLS : sig
88
(** Thread-local storage.
99
1010
Note that here "thread" refers to system level threads rather than fibers
11-
or domains. In case a system level thread implementation, i.e. the
11+
or domains. In case a system level thread implementation, i.e. the
1212
[threads.posix] library, is not available, this will use
1313
{!Picos_domain.DLS}. *)
1414

@@ -30,7 +30,7 @@ module TLS : sig
3030
current thread or raises {!Not_set} in case no value has been {!set} for
3131
the key.
3232
33-
⚠️ The {!Not_set} exception is raised with no backtrace. Always catch the
33+
⚠️ The {!Not_set} exception is raised with no backtrace. Always catch the
3434
exception unless it is known that a value has been set. *)
3535

3636
val set : 'a t -> 'a -> unit

lib/picos/intf.ocaml5.ml

+19-20
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ module type Trigger = sig
1010
1111
Typically the scheduler calls {{!Fiber.try_suspend} [try_suspend]}, which
1212
in turn calls {!on_signal}, to attach a scheduler specific [resume] action
13-
to the [trigger]. The scheduler must guarantee that the fiber will be
13+
to the [trigger]. The scheduler must guarantee that the fiber will be
1414
resumed after {!signal} has been called on the [trigger].
1515
1616
Whether being resumed due to cancelation or not, the trigger must be
17-
either {{!signal} signaled} outside of the effect handler, or {{!dispose}
18-
disposed} by the effect handler, before resuming the fiber.
17+
either {{!signal} signaled} outside of the effect handler, or
18+
{{!dispose} disposed} by the effect handler, before resuming the fiber.
1919
2020
In case the fiber permits propagation of cancelation and the computation
2121
associated with the fiber has been canceled the scheduler is free to
@@ -37,9 +37,9 @@ module type Computation = sig
3737
(** Schedulers must handle the {!Cancel_after} effect to implement the
3838
behavior of {!cancel_after}.
3939
40-
The scheduler should typically {{!try_attach} attach} a {{!Trigger}
41-
trigger} to the computation passed with the effect and arrange the
42-
timeout to be canceled upon signal to avoid space leaks.
40+
The scheduler should typically {{!try_attach} attach} a
41+
{{!Trigger} trigger} to the computation passed with the effect and arrange
42+
the timeout to be canceled upon signal to avoid space leaks.
4343
4444
The scheduler should measure time using a monotonic clock.
4545
@@ -80,15 +80,15 @@ module type Fiber = sig
8080
('b, 'r) Effect.Shallow.handler ->
8181
'r
8282
(** [resume_with fiber k h] is equivalent to
83-
{{!Fiber.canceled} [Effect.Shallow.continue_with k (Fiber.canceled t) h]}. *)
83+
{{!Fiber.canceled} [Effect.Shallow.continue_with k (Fiber.canceled t) h]}.
84+
*)
8485

8586
val continue : t -> ('v, 'r) Effect.Deep.continuation -> 'v -> 'r
8687
(** [continue fiber k v] is equivalent to:
8788
{[
8889
match Fiber.canceled fiber with
8990
| None -> Effect.Deep.continue k v
90-
| Some (exn, bt) ->
91-
Effect.Deep.discontinue_with_backtrace k exn bt
91+
| Some (exn, bt) -> Effect.Deep.discontinue_with_backtrace k exn bt
9292
]} *)
9393

9494
val continue_with :
@@ -101,20 +101,19 @@ module type Fiber = sig
101101
{[
102102
match Fiber.canceled fiber with
103103
| None -> Effect.Shallow.continue_with k v h
104-
| Some (exn, bt) ->
105-
Effect.Shallow.discontinue_with_backtrace k exn bt h
104+
| Some (exn, bt) -> Effect.Shallow.discontinue_with_backtrace k exn bt h
106105
]} *)
107106

108107
(** Schedulers must handle the {!Current} effect to implement the behavior of
109108
{!current}.
110109
111110
⚠️ The scheduler must eventually resume the fiber without propagating
112-
cancelation. This is necessary to allow a fiber to control the
113-
propagation of cancelation through the {{!t} fiber}.
111+
cancelation. This is necessary to allow a fiber to control the propagation
112+
of cancelation through the {{!t} fiber}.
114113
115-
The scheduler is free to choose which ready fiber to resume next.
116-
However, in typical use cases of {!current} it makes sense to give
117-
priority to the fiber performing {!Current}, but this is not required. *)
114+
The scheduler is free to choose which ready fiber to resume next. However,
115+
in typical use cases of {!current} it makes sense to give priority to the
116+
fiber performing {!Current}, but this is not required. *)
118117
type _ Effect.t += private Current : t Effect.t
119118

120119
(** Schedulers must handle the {!Yield} effect to implement the behavior of
@@ -125,7 +124,7 @@ module type Fiber = sig
125124
discontinue the fiber immediately.
126125
127126
The scheduler should give priority to running other ready fibers before
128-
resuming the fiber performing {!Yield}. A scheduler that always
127+
resuming the fiber performing {!Yield}. A scheduler that always
129128
immediately resumes the fiber performing {!Yield} may prevent an otherwise
130129
valid program from making progress. *)
131130
type _ Effect.t += private Yield : unit Effect.t
@@ -139,7 +138,7 @@ module type Fiber = sig
139138
⚠️ In case the fiber performing {!Spawn} permits propagation of cancelation
140139
and the computation associated with the fiber has been canceled before it
141140
performed {!Spawn}, the scheduler should discontinue the current fiber and
142-
not spawn a new fiber. If cancelation happens during the handling of
141+
not spawn a new fiber. If cancelation happens during the handling of
143142
{!Spawn} the scheduler is free to either spawn a new fiber, in which case
144143
the current fiber must be continued normally, or not spawn a fiber, in
145144
which case the current fiber must be discontinued, i.e. {!spawn} raises an
@@ -151,9 +150,9 @@ module type Fiber = sig
151150
called.
152151
153152
In other words, spawn should (effectively) check cancelation at least once
154-
and be all or nothing. Furthermore, in case a newly spawned fiber is
153+
and be all or nothing. Furthermore, in case a newly spawned fiber is
155154
canceled before its [main] is called, the scheduler must still call the
156-
[main]. This allows a program to ensure, i.e. keep track of, that all
155+
[main]. This allows a program to ensure, i.e. keep track of, that all
157156
fibers it spawns are terminated properly and any resources transmitted to
158157
spawned fibers will be disposed properly. *)
159158
type _ Effect.t +=

0 commit comments

Comments
 (0)