Utilities #
Equations
- Lake.instCheckExistsFilePath = { checkExists := System.FilePath.pathExists }
Trace Abstraction #
Equations
- Lake.computeTrace info = liftM (Lake.ComputeTrace.computeTrace info)
Instances For
- nilTrace : t
The nil trace. Should not unduly clash with a proper trace.
Instances
Equations
- Lake.instInhabited = { default := Lake.nilTrace }
- mixTrace : t → t → t
Combine two traces. The result should be dirty if either of the inputs is dirty.
Instances
Equations
- Lake.mixTraceList traces = List.foldl Lake.mixTrace Lake.nilTrace traces
Instances For
Equations
- Lake.mixTraceArray traces = Array.foldl Lake.mixTrace Lake.nilTrace traces 0
Instances For
Equations
- Lake.computeListTrace artifacts = List.foldlM (fun (ts : t) (t_1 : i) => do let __do_lift ← Lake.computeTrace t_1 pure (Lake.mixTrace ts __do_lift)) Lake.nilTrace artifacts
Instances For
Equations
- Lake.instComputeTraceList = { computeTrace := Lake.computeListTrace }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.instComputeTraceArray = { computeTrace := Lake.computeArrayTrace }
Hash Trace #
Equations
Equations
- Lake.instReprHash = { reprPrec := Lake.reprHash✝ }
Equations
- Lake.Hash.load? hashFile = EIO.catchExceptions ((fun (x : String) => Option.map Lake.Hash.ofNat (String.toNat? x)) <$> IO.FS.readFile hashFile) fun (x : IO.Error) => pure none
Instances For
Equations
- Lake.Hash.instNilTraceHash = { nilTrace := Lake.Hash.nil }
Equations
- Lake.Hash.instMixTraceHash = { mixTrace := Lake.Hash.mix }
Equations
- Lake.Hash.instToStringHash = { toString := Lake.Hash.toString }
Equations
- Lake.Hash.ofString str = Lake.Hash.mix Lake.Hash.nil { val := hash str }
Instances For
Equations
- Lake.instComputeTraceHash = { computeTrace := Lake.ComputeHash.computeHash }
Equations
Instances For
Equations
Instances For
Equations
- Lake.instComputeHashStringId = { computeHash := Lake.Hash.ofString }
Equations
Instances For
Equations
- Lake.instComputeHashFilePathIO = { computeHash := Lake.computeFileHash }
This is the same as String.replace text "\r\n" "\n"
, but more efficient.
Equations
- Lake.crlf2lf text = Lake.crlf2lf.go text "" 0 0
Instances For
Equations
- Lake.computeTextFileHash file = do let text ← IO.FS.readFile file let text : String := Lake.crlf2lf text pure (Lake.Hash.ofString text)
Instances For
A wrapper around FilePath
that adjusts its ComputeHash
implementation
to normalize \r\n
sequences to \n
for cross-platform compatibility.
- path : Lake.FilePath
Instances For
Equations
- Lake.instCoeTextFilePathFilePath = { coe := fun (x : Lake.TextFilePath) => x.path }
Equations
- Lake.instComputeHashTextFilePathIO = { computeHash := fun (file : Lake.TextFilePath) => Lake.computeTextFileHash file.path }
Equations
- Lake.computeArrayHash xs = Array.foldlM (fun (h : Lake.Hash) (a : α) => do let __do_lift ← Lake.computeHash a pure (Lake.Hash.mix h __do_lift)) Lake.Hash.nil xs 0
Instances For
Equations
- Lake.instComputeHashArray = { computeHash := Lake.computeArrayHash }
Modification Time (MTime) Trace #
Equations
- Lake.MTime.instOfNatMTime = { ofNat := { sec := 0, nsec := 0 } }
Equations
Equations
Equations
Equations
- Lake.MTime.instNilTraceMTime = { nilTrace := 0 }
Equations
- Lake.MTime.instMixTraceMTime = { mixTrace := max }
Equations
- Lake.instComputeTraceIOMTime = { computeTrace := Lake.getMTime }
Equations
- Lake.getFileMTime file = do let __do_lift ← System.FilePath.metadata file pure __do_lift.modified
Instances For
Equations
- Lake.instGetMTimeFilePath = { getMTime := Lake.getFileMTime }
Equations
- Lake.instGetMTimeTextFilePath = { getMTime := fun (x : Lake.TextFilePath) => Lake.getFileMTime x.path }
Lake Build Trace (Hash + MTIme) #
Trace used for common Lake targets. Combines Hash
and MTime
.
- hash : Lake.Hash
- mtime : Lake.MTime
Instances For
Equations
- Lake.instReprBuildTrace = { reprPrec := Lake.reprBuildTrace✝ }
Equations
Equations
- Lake.BuildTrace.ofMTime mtime = { hash := Lake.Hash.nil, mtime := mtime }
Instances For
Equations
Equations
- Lake.BuildTrace.nil = { hash := Lake.Hash.nil, mtime := 0 }
Instances For
Equations
- Lake.BuildTrace.instNilTraceBuildTrace = { nilTrace := Lake.BuildTrace.nil }
Equations
- Lake.BuildTrace.compute info = do let __do_lift ← Lake.computeHash info let __do_lift_1 ← Lake.getMTime info pure { hash := __do_lift, mtime := __do_lift_1 }
Instances For
Equations
- Lake.BuildTrace.instComputeTraceIOBuildTrace = { computeTrace := Lake.BuildTrace.compute }
Equations
- Lake.BuildTrace.mix t1 t2 = { hash := Lake.Hash.mix t1.hash t2.hash, mtime := max t1.mtime t2.mtime }
Instances For
Equations
- Lake.BuildTrace.instMixTraceBuildTrace = { mixTrace := Lake.BuildTrace.mix }
Check if the info is up-to-date using a hash. That is, check that info exists and its input hash matches this trace's hash.
Equations
- Lake.BuildTrace.checkAgainstHash info hash self = (pure (hash == self.hash) <&&> Lake.checkExists info)
Instances For
Check if the info is up-to-date using modification time. That is, check if the info is newer than this input trace's modification time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Check if the info is up-to-date using a trace file. If the file exists, match its hash to this trace's hash. If not, check if the info is newer than this trace's modification time.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.BuildTrace.writeToFile traceFile self = IO.FS.writeFile traceFile (Lake.Hash.toString self.hash)