Skip to content

Commit

Permalink
Improve Action_builder.memo comments
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Mokhov <amokhov@janestreet.com>
  • Loading branch information
snowleopard committed Nov 13, 2023
1 parent 09778b1 commit 6e1b343
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dune_engine/action_builder0.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ module T = struct
}
;;

let of_memo m =
let of_memo memo =
{ f =
(fun mode ->
let+ x = m in
let+ x = memo in
x, Deps_or_facts.empty mode)
}
;;
Expand Down
11 changes: 10 additions & 1 deletion src/dune_engine/action_builder0.mli
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,20 @@ val exec_memo : ('i, 'o) memo -> 'i -> 'o t
but the contents of [p] is irrelevant. *)
val goal : 'a t -> 'a t

(** If you're thinking of using [Process.run] here, check that: (i) you don't in
(** An action builder with no dependencies. Consider passing [Memo.of_thunk] to delay
forcing the computation until the action's dependencies need to be determined.
If you're thinking of using [Process.run] here, check that: (i) you don't in
fact need [Command.run], and that (ii) [Process.run] only reads the declared
build rule dependencies. *)
val of_memo : 'a Memo.t -> 'a t

(** Like [of_memo_forced] but takes a thunk. *)
val of_memo : (unit -> 'a Memo.t) -> 'a t

(** Like [of_memo] but accepts functions of any argument. *)
val of_memo_apply : ('a -> 'b Memo.t) -> 'a -> 'b t

(** {1 Execution} *)

(** Evaluation mode.
Expand Down

0 comments on commit 6e1b343

Please sign in to comment.