Equations
- Lake.JobAction.verb failed Lake.JobAction.unknown = if failed = true then "Running" else "Ran"
- Lake.JobAction.verb failed Lake.JobAction.replay = if failed = true then "Replaying" else "Replayed"
- Lake.JobAction.verb failed Lake.JobAction.fetch = if failed = true then "Fetching" else "Fetched"
- Lake.JobAction.verb failed Lake.JobAction.build = if failed = true then "Building" else "Built"
Instances For
Resets the job state after a checkpoint (e.g., registering the job). Preserves state that downstream jobs want to depend on while resetting job-local state that should not be inherited by downstream jobs.
Equations
- s.renew = { log := ∅, action := Lake.JobAction.unknown, trace := s.trace }
Instances For
Equations
- a.merge b = { log := a.log ++ b.log, action := a.action.merge b.action, trace := Lake.mixTrace a.trace b.trace }
Instances For
Equations
- Lake.JobState.modifyLog f s = { log := f s.log, action := s.action, trace := s.trace }
Instances For
Add log entries to the beginning of the job's log.
Equations
- Lake.JobResult.prependLog log (Lake.EResult.ok a s) = Lake.EResult.ok a (Lake.JobState.modifyLog (fun (x : Lake.Log) => log ++ x) s)
- Lake.JobResult.prependLog log (Lake.EResult.error e s) = Lake.EResult.error { val := log.size + e.val } (Lake.JobState.modifyLog (fun (x : Lake.Log) => log ++ x) s)
Instances For
The monad of asynchronous Lake jobs.
While this can be lifted into FetchM
, job action should generally
be wrapped into an asynchronous job (e.g., via Job.async
) instead of being
run directly in FetchM
.
Equations
Instances For
Equations
- Lake.instMonadLiftLakeMBuildTOfPure = { monadLift := fun {α : Type} (x : Lake.LakeM α) (ctx : Lake.BuildContext) => pure (Lake.LakeM.run ctx.toContext x) }
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lake.instMonadLiftLogIOJobM = { monadLift := fun {α : Type} => Lake.ELogT.takeAndRun }
Record that this job is trying to perform some action.
Equations
- Lake.updateAction action = modify fun (s : Lake.JobState) => { log := s.log, action := s.action.merge action, trace := s.trace }
Instances For
Returns the current job's build trace.
Equations
- Lake.getTrace = (fun (x : Lake.JobState) => x.trace) <$> get
Instances For
Sets the current job's build trace.
Equations
- Lake.setTrace trace = modify fun (s : Lake.JobState) => { log := s.log, action := s.action, trace := trace }
Instances For
Mix a trace into the current job's build trace.
Equations
- Lake.addTrace trace = modify fun (s : Lake.JobState) => { log := s.log, action := s.action, trace := s.trace.mix trace }
Instances For
Returns the current job's build trace and removes it from the state.
Equations
- Lake.takeTrace = modifyGet fun (s : Lake.JobState) => (s.trace, { log := s.log, action := s.action, trace := Lake.nilTrace })
Instances For
The monad used to spawn asynchronous Lake build jobs. Lifts into FetchM
.
Equations
Instances For
Equations
- Lake.JobM.runSpawnM x ctx s = do let __do_lift ← x ctx s.trace pure (Lake.EResult.ok __do_lift s)
Instances For
Equations
- Lake.instMonadLiftSpawnMJobM = { monadLift := fun {α : Type} => Lake.JobM.runSpawnM }
The monad used to spawn asynchronous Lake build jobs. Replaced by SpawnM
.
Equations
Instances For
Forget the value of a job. Implemented as a no-op cast.
Equations
- job.toOpaque = { task := Task.map (fun (x : Lake.JobResult α) => Lake.EResult.map Opaque.mk x) job.task, caption := job.caption, optional := job.optional }
Instances For
Equations
- Lake.instCoeOutJobOpaqueJob = { coe := Lake.Job.toOpaque }
Equations
- Lake.Job.ofTask task caption = { task := task, caption := caption, optional := false }
Instances For
Equations
- Lake.Job.pure a log caption = { task := { get := Lake.EResult.ok a { log := log, action := Lake.JobAction.unknown, trace := Lake.BuildTrace.nil } }, caption := caption, optional := false }
Instances For
Equations
- Lake.Job.instPure = { pure := fun {α : Type ?u.6} (a : α) => Lake.Job.pure a }
Equations
- Lake.Job.instInhabited = { default := pure default }
Equations
Instances For
Sets the job's caption.
Equations
- Lake.Job.setCaption caption job = { task := job.task, caption := caption, optional := job.optional }
Instances For
Sets the job's caption if the job's current caption is empty.
Equations
- Lake.Job.setCaption? caption job = if job.caption.isEmpty = true then { task := job.task, caption := caption, optional := job.optional } else job
Instances For
Equations
- Lake.Job.mapResult f self prio sync = { task := Task.map f self.task prio sync, caption := self.caption, optional := self.optional }
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Job.bindTask f self = do let __do_lift ← f self.task pure { task := __do_lift, caption := self.caption, optional := self.optional }
Instances For
Equations
- Lake.Job.map f self prio sync = Lake.Job.mapResult (fun (x : Lake.JobResult α) => Lake.EResult.map f x) self prio sync
Instances For
Equations
- One or more equations did not get rendered due to their size.
Resets the job's state after a checkpoint (e.g., registering the job). Preserves information that downstream jobs want to depend on while resetting job-local information that should not be inherited by downstream jobs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Spawn a job that asynchronously performs act
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Wait a the job to complete and return the result.
Instances For
Wait for a job to complete and return the produced value.
If an error occurred, return none
and discarded any logs produced.
Equations
- self.wait? = do let __do_lift ← self.wait pure (Lake.EResult.result? __do_lift)
Instances For
Wait for a job to complete and return the produced value. Logs the job's log and throws if there was an error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply f
asynchronously to the job's output.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- self.bindSync f prio sync = self.mapM f prio sync
Instances For
Apply f
asynchronously to the job's output
and asynchronously await the resulting job.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Instances For
a.zipWith f b
produces a new job c
that applies f
to the
results of a
and b
. The job c
errors if either a
or b
error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
a.zipWith f b
produces a new job c
that applies f
to the
results of a
and b
. The job c
errors if either a
or b
error.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Merge a List
of jobs into one, discarding their outputs.
Equations
- Lake.Job.mixList jobs = List.foldr (fun (x1 : Lake.Job α) (x2 : Lake.Job Unit) => x1.mix x2) Lake.Job.nil jobs
Instances For
Merge an Array
of jobs into one, discarding their outputs.
Equations
- Lake.Job.mixArray jobs = Array.foldl (fun (x1 : Lake.Job Unit) (x2 : Lake.Job α) => x1.mix x2) Lake.Job.nil jobs
Instances For
Merge a List
of jobs into one, collecting their outputs into a List
.
Equations
- Lake.Job.collectList jobs = List.foldr (fun (self : Lake.Job α) (other : Lake.Job (List α)) => Lake.Job.zipWith List.cons self other) (pure []) jobs
Instances For
Merge an Array
of jobs into one, collecting their outputs into an Array
.
Equations
- Lake.Job.collectArray jobs = Array.foldl (fun (self : Lake.Job (Array α)) (other : Lake.Job α) => Lake.Job.zipWith Array.push self other) (pure (Array.mkEmpty jobs.size)) jobs
Instances For
A Lake build job.
Equations
- Lake.BuildJob α = Lake.Job α
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.BuildJob.ofJob job = Lake.Job.mapOk (fun (trace : Lake.BuildTrace) (s : Lake.JobState) => Lake.EResult.ok () { log := s.log, action := s.action, trace := trace }) job
Instances For
Equations
Instances For
Equations
Instances For
Equations
- Lake.BuildJob.instPure = { pure := fun {α : Type ?u.6} (a : α) => Lake.Job.pure a }
Equations
- Lake.BuildJob.map f self = Lake.Job.map f self.toJob
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- self.bindAsync f prio sync = self.toJob.bindM (fun (a : α) => do let __do_lift ← Lake.getTrace liftM (f a __do_lift)) prio sync
Instances For
Equations
- self.wait? = self.toJob.wait?
Instances For
Equations
- self.add other = self.toJob.add other.toJob
Instances For
Equations
- self.mix other = self.toJob.mix other.toJob
Instances For
Equations
- Lake.BuildJob.mixList jobs = pure (Lake.Job.mixList jobs)
Instances For
Equations
- Lake.BuildJob.mixArray jobs = pure (Lake.Job.mixArray jobs)
Instances For
Equations
- Lake.BuildJob.zipWith f self other = Lake.Job.zipWith f self.toJob other.toJob
Instances For
Equations
- Lake.BuildJob.collectList jobs = pure (Lake.Job.collectList jobs)
Instances For
Equations
- Lake.BuildJob.collectArray jobs = pure (Lake.Job.collectArray jobs)