Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file s.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281type'aor_error=('a,[`Msgofstring])resulttypestats={ok:int;waiting_for_confirmation:int;ready:int;running:int;failed:int;blocked:int;}(** Counters showing how many pipeline stages are in each state. *)moduletypeT=sigtypetvalequal:t->t->boolvalpp:tFmt.tendmoduletypeORDERED=sigincludeMap.OrderedTypevalpp:tFmt.tendmoduletypeANALYSIS=sigtype'aterm(** See [TERM]. *)typemetadata(** Extra data provided by primitives but that isn't part of the value that is
passed on to other nodes. For example, a job ID. *)valmetadata:'aterm->metadataoptionterm(** [metadata t] is the metadata of [t], if any.
Raises an exception if [t] is not a primitive (or a map of one). *)valpp:_termFmt.t(** [pp] formats a [t] as a simple string. *)valpp_dot:env:(string*string)list->collapse_link:(k:string->v:string->stringoption)->job_info:(metadata->Output.activeoption*stringoption)->_termFmt.t(** [pp_dot ~env ~collapse_link ~job_info] formats a [t] as a graphviz dot graph.
@param env A list of key-value pairs from the URL to control rendering.
@param collapse_link Should return a link to the same page with "?k=v"
added to the environment.
@param job_info Get update statuses and URLs for links to jobs.
The update status is used if the job is rebuilding while
showing the output of a previous run. The box is
displayed using a gradient from the update status colour
to the current output colour. *)(** {2 Stats} *)valstat:_term->stats(** [stat t] count how many stages are in each state.
This can be slow for large pipelines. Consider using {!quick_stat} instead. *)valquick_stat:unit->stats(** [quick_stat ()] returns the current values of the counters. This is O(1).
It only counts some operations (binds, primitives and of_output). *)endmoduletypeTERM=sigtype'at(** An ['a t] is a term that produces a value of type ['a]. *)typedescription(** Information about operations hidden behind a bind. *)valactive:Output.active->'at(** [active x] is a term indicating that the result is not determined yet. *)valreturn:?label:string->'a->'at(** [return x] is a term that immediately succeeds with [x].
@param label Label the constant in the diagrams. *)valfail:string->'at(** [fail m] is a term that immediately fails with message [m]. *)valstate:?hidden:bool->'at->('a,[`ActiveofOutput.active|`Msgofstring])resultt(** [state t] always immediately returns a successful result giving the current state of [t].
@param hidden If [true], don't show a separate node for this on the diagrams. *)valcatch:?hidden:bool->'at->'aor_errort(** [catch t] successfully returns [Ok x] if [t] evaluates successfully to [x],
or successfully returns [Error e] if [t] fails with error [e].
If [t] is active then [catch t] will be active too.
@param hidden If [true], don't show a separate node for this on the diagrams. *)valignore_value:'at->unitt(** [ignore_value x] is [map ignore x]. *)valof_output:'aOutput.t->'at(** [of_output x] is a returned, failed or active term. *)(** {1 Sequencing terms} *)(** {2 Applicative operations} *)valmap:?eq:('b->'b->bool)->('a->'b)->'at->'bt(** [map f x] is a term that runs [x] and then transforms the result using [f].
The optional equality function [?eq] defaults to physical equality. When
[f] produces an updated result following a change in [x], the equality
function will be called with the previous and the new value [eq b_old b_new]:
returning [true] indicates that the change can be ignored and should
not propagate further down the pipeline. *)valmap_error:(string->string)->'at->'at(** [map_error f x] is a term that runs [x] and then transforms the error string (if any) using [f]. *)valpair:'at->'bt->('a*'b)t(** [pair a b] is the pair containing the results of evaluating [a] and [b]
(in parallel). *)vallist_map:(moduleORDEREDwithtypet='a)->?collapse_key:string->?label:string->('at->'bt)->'alistt->'blistt(** [list_map (module T) f xs] adds [f] to the end of each input term
and collects all the results into a single list.
@param T Used to display labels for each item, and to avoid recreating pipelines
unnecessarily.
@param collapse_key If given, each element is wrapped with [collapse].
@param label Label the list in the diagrams. *)vallist_iter:(moduleORDEREDwithtypet='a)->?collapse_key:string->?label:string->('at->unitt)->'alistt->unitt(** Like [list_map] but for the simpler case when the result is unit.
@param label Label the list in the diagrams.*)vallist_seq:'atlist->'alistt(** [list_seq x] evaluates to a list containing the results of evaluating
each element in [x], once all elements of [x] have successfully completed. *)valoption_map:?label:string->('at->'bt)->'aoptiont->'boptiont(** [option_map f x] is a term that evaluates to [Some (f y)] if [x]
evaluates to [Some y], or to [None] otherwise.
@param label Label the optional in the diagrams. *)valoption_iter:?label:string->('at->unitt)->'aoptiont->unitt(** Like [option_map] but for the simpler case when the result is unit.
@param label Label the list in the diagrams. *)valoption_seq:'atoption->'aoptiont(** [option_seq None] is [Current.return None] and
[option_seq (Some x)] is [Current.map some x].
This is useful for handling optional arguments that are currents. *)valall:unittlist->unitt(** [all xs] is a term that succeeds if every term in [xs] succeeds. *)valall_labelled:(string*unitt)list->unitt(** [all xs] is a term that succeeds if every term in [xs] succeeds.
The labels are used if some terms fail, to indicate which ones
are failing. *)valgate:on:unitt->'at->'at(** [gate ~on:ctrl x] is the same as [x], once [ctrl] succeeds.
Note: [gate] does {i not} delay [x]; it only delays whatever you put after the gate.
e.g.
{[
let binary = build src in
let tests_ok = test binary in
binary |> gate ~on:tests_ok |> deploy
]}
*)valcutoff:eq:('a->'a->bool)->'at->'at(** [cutoff ~eq x] is the same as [x], but changes to [x] that are equal
according to [eq] do not propagate further down. It should be used
when values of type ['a] have a precise definition of equality
to avoid triggering redundant work.
*)(** {2 Diagram control} *)valcollapse:key:string->value:string->input:_t->'at->'at(** [collapse ~key ~value ~input t] is a term that behaves just like [t], but
when shown in a diagram it can be expanded or collapsed. When collapsed,
it is shown as "input -> [+]" and the user can expand it to show [t]
instead. The idea is that [input] is a dependency of [t] and the "+"
represents everything in [t] after that. [key] and [value] are used
as the parameters (e.g. in a URL) to control whether this is expanded or
not. For example
[collapse ~key:"repo" ~value:"mirage/mirage-www" ~input:repo (process repo)]
Note: [list_map ~collapse_key] provides an easy way to use this. *)valcollapse_list:key:string->value:string->input:_t->'atlist->'atlist*unitt(** [collapse_list ~key ~value ~input t] is a term that behaves just like [t] list, but
when shown in a diagram it can be expanded or collapsed. *)valwith_context:_t->(unit->'at)->'at(** [with_context ctx f] is the term [f ()], where [f] is evaluated in
context [ctx]. This means that [ctx] will be treated as an input to all
terms created by [f] in the diagrams. *)(** {2 Monadic operations} *)(** {b N.B.} these operations create terms that cannot be statically
analysed until after they are executed. *)valbind:?info:description->?eq:('b->'b->bool)->('a->'bt)->'at->'bt(** [bind f x] is a term that first runs [x] to get [y] and then behaves as
the term [f y]. Static analysis cannot look inside the [f] function until
[x] is ready, so using [bind] makes static analysis less useful. You can
use the [info] argument to provide some information here. *)(** {2 Primitives} *)typemetadata(** See [ANALYSIS]. *)type'aprimitivevalprimitive:info:description->('a->'bprimitive)->'at->'bt(** [primitive ~info f x] is a term that evaluates [f] on each new value of [x].
This is used to provide the primitive operations, which can then be
combined using the other combinators in this module.
[info] is used to label the operation in the diagram. *)valcomponent:('a,Format.formatter,unit,description)format4->'a(** [component name] is used to annotate binds, so that the system can show a
name for the operations hidden inside the bind's function. [name] is used
as the label for the bind in the generated dot diagrams.
For convenience, [name] can also be a format string. *)valobserve:'at->'aOutput.Blockable.t(** [observe x] evaluates the current state of term [x]. A [`Blocked] value
occurs when the term failed because an upstream dependency errored. *)moduleSyntax:sig(** {1 Applicative syntax} *)val(let+):'at->('a->'b)->'bt(** Syntax for {!map}. Use this to process the result of a term without
using any special effects. *)val(and+):'at->'bt->('a*'b)t(** Syntax for {!pair}. Use this to depend on multiple terms. *)(** {1 Monadic syntax } *)val(let*):'at->('a->'bt)->'bt(** Monadic {!bind}. Use this if the next part of your pipeline can only
be determined at runtime by looking at the concrete value. Static
analysis cannot predict what this will do until the input is ready. *)val(let>):'at->('a->'bprimitive)->description->'bt(** [let>] is used to define a component. e.g.:
{[
component "my-op" |>
let> x = fetch uri in
...
]} *)val(let**):'at->('a->'bt)->description->'bt(** Like {!let*}, but allows you to name the operation. e.g.:
{[
component "my-op" |>
let** x = fetch uri in
...
]} *)val(and*):'at->'bt->('a*'b)t(** Syntax for {!pair}. Use this to depend on multiple terms.
Note: this is the same as {!and+}. *)val(and>):'at->'bt->('a*'b)t(** Syntax for {!pair}. Use this to depend on multiple terms.
Note: this is the same as {!and+}. *)endendmoduletypeEXECUTOR=sigtype'aterm(** See [TERM]. *)valrun:'aterm->'aOutput.tCurrent_incr.t(** [run t] is the output value of [t] (i.e. without the static analysis part). *)end