package opam-core

  1. Overview
  2. Docs

Open type and add combinators. Meant to be opened

type 'a job =
  1. | Done of 'a
  2. | Run of command * result -> 'a job
val (@@>) : command -> (result -> 'a job) -> 'a job

Stage a shell command with its continuation, eg:

command "ls" ["-a"] @@> fun result ->
if OpamProcess.is_success result then Done result.r_stdout
else failwith "ls"
val (@@+) : 'a job -> ('a -> 'b job) -> 'b job

job1 @@+ fun r -> job2 appends the computation of tasks in job2 after job1

val (@@|) : 'a job -> ('a -> 'b) -> 'b job

job @@| f maps f on the results of job. Equivalent to job @@+ fun r -> Done (f r)

OCaml

Innovation. Community. Security.