Skip to content

Commit 46123d4

Browse files
committed
Documentation adjustments
1 parent 293be1a commit 46123d4

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

lib/picos/intf.ocaml5.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ module type Fiber = sig
5252

5353
val resume : t -> (exn_bt option, 'r) Effect.Deep.continuation -> 'r
5454
(** [resume fiber k] is equivalent to
55-
[Effect.Deep.continue k (Fiber.canceled t)]. *)
55+
{{!Fiber.canceled} [Effect.Deep.continue k (Fiber.canceled t)]}. *)
5656

5757
val resume_with :
5858
t ->
5959
(exn_bt option, 'b) Effect.Shallow.continuation ->
6060
('b, 'r) Effect.Shallow.handler ->
6161
'r
6262
(** [resume_with fiber k h] is equivalent to
63-
[Effect.Shallow.continue_with k (Fiber.canceled t) h]. *)
63+
{{!Fiber.canceled} [Effect.Shallow.continue_with k (Fiber.canceled t) h]}. *)
6464

6565
val continue : t -> ('v, 'r) Effect.Deep.continuation -> 'v -> 'r
6666
(** [continue fiber k v] is equivalent to:

lib/picos/picos.mli

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ module Trigger : sig
304304
structured concurrency mechanisms. If you know what you are doing, use \
305305
[@alert \"-handler\"]."]
306306
(** [from_action x y resume] is equivalent to
307-
[let t = create () in assert (on_signal t x y resume); t].
307+
{{!on_signal} [let t = create () in assert (on_signal t x y resume); t]}.
308308
309309
⚠️ The action that you attach to a trigger must be safe to call from any
310310
context that might end up signaling the trigger directly or indirectly
@@ -522,14 +522,15 @@ module Computation : sig
522522

523523
val return : 'a t -> 'a -> unit
524524
(** [return computation value] is equivalent to
525-
[try_return computation value |> ignore]. *)
525+
{{!try_return} [try_return computation value |> ignore]}. *)
526526

527527
val try_finish : unit t -> bool
528-
(** [try_finish computation] is equivalent to [try_return computation ()]. *)
528+
(** [try_finish computation] is equivalent to
529+
{{!try_return} [try_return computation ()]}. *)
529530

530531
val finish : unit t -> unit
531532
(** [finish computation] is equivalent to
532-
[try_finish computation |> ignore]. *)
533+
{{!try_finish} [try_finish computation |> ignore]}. *)
533534

534535
val try_capture : 'a t -> ('b -> 'a) -> 'b -> bool
535536
(** [try_capture computation fn x] calls [fn x] and tries to complete the
@@ -539,7 +540,7 @@ module Computation : sig
539540

540541
val capture : 'a t -> ('b -> 'a) -> 'b -> unit
541542
(** [capture computation fn x] is equivalent to
542-
[try_capture computation fn x |> ignore]. *)
543+
{{!try_capture} [try_capture computation fn x |> ignore]}. *)
543544

544545
(** {2 Interface for canceling} *)
545546

@@ -554,7 +555,7 @@ module Computation : sig
554555

555556
val cancel : 'a t -> Exn_bt.t -> unit
556557
(** [cancel computation exn_bt] is equivalent to
557-
[try_cancel computation exn_bt |> ignore]. *)
558+
{{!try_cancel} [try_cancel computation exn_bt |> ignore]}. *)
558559

559560
(** {2 Interface for timeouts} *)
560561

@@ -591,7 +592,7 @@ module Computation : sig
591592

592593
val check : 'a t -> unit
593594
(** [check computation] is equivalent to
594-
[Option.iter Exn_bt.raise (canceled computation)]. *)
595+
{{!canceled} [Option.iter Exn_bt.raise (canceled computation)]}. *)
595596

596597
val peek : 'a t -> ('a, Exn_bt.t) result option
597598
(** [peek computation] returns the result of the computation or [None] in case
@@ -743,8 +744,8 @@ module Fiber : sig
743744
current handler}. *)
744745

745746
val sleep : seconds:float -> unit
746-
(** [sleep ~seconds] suspends the current fiber for specified number of
747-
seconds. *)
747+
(** [sleep ~seconds] suspends the current fiber for the specified number of
748+
[seconds]. *)
748749

749750
(** {2 Interface for spawning} *)
750751

@@ -1041,7 +1042,7 @@ module Fiber : sig
10411042

10421043
val create : forbid:bool -> 'a Computation.t -> t
10431044
(** [create ~forbid computation] is equivalent to
1044-
[create_packed ~forbid (Computation.Packed computation)]. *)
1045+
{{!create_packed} [create_packed ~forbid (Computation.Packed computation)]}. *)
10451046

10461047
val try_suspend :
10471048
t -> Trigger.t -> 'x -> 'y -> (Trigger.t -> 'x -> 'y -> unit) -> bool

lib/picos_stdio/picos_stdio.mli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ module Unix : sig
6161
descriptor. *)
6262

6363
val close_pair : file_descr * file_descr -> unit
64-
(** [close_pair (fd1, fd2)] is equivalent to [close fd1; close fd2]. *)
64+
(** [close_pair (fd1, fd2)] is equivalent to
65+
{{!close} [close fd1; close fd2]}. *)
6566

6667
type error = Unix.error =
6768
| E2BIG

lib/picos_structured/picos_structured.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ module Control : sig
121121
(** [yield ()] asks the current fiber to be rescheduled. *)
122122

123123
val sleep : seconds:float -> unit
124-
(** [sleep ~seconds] suspends the current fiber for specified number of
125-
seconds. *)
124+
(** [sleep ~seconds] suspends the current fiber for the specified number of
125+
[seconds]. *)
126126

127127
val protect : (unit -> 'a) -> 'a
128128
(** [protect thunk] forbids propagation of cancelation for the duration of

lib/picos_sync/picos_sync.mli

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ module Lazy : sig
145145
(** [force_val] is a synonym for {!force}. *)
146146

147147
val map : ('a -> 'b) -> 'a t -> 'b t
148-
(** [map fn susp] is equivalent to [from_fun (fun () -> fn (force susp))] *)
148+
(** [map fn susp] is equivalent to
149+
{{!from_fun} [from_fun (fun () -> fn (force susp))]}. *)
149150

150151
val map_val : ('a -> 'b) -> 'a t -> 'b t
151152
(** [map_val fn susp] is equivalent to:

0 commit comments

Comments
 (0)