The Lake Build Store #
The Lake build store is the map of Lake build keys to build task and/or build results that is slowly filled during a recursive build (e.g., via topological-based build of an initial key's dependencies).
Pure State #
The type of the Lake build store.
Equations
- Lake.BuildStore = Std.DTreeMap Lake.BuildKey (fun (x : Lake.BuildKey) => Lake.Job (Lake.BuildData x)) Lake.BuildKey.quickCmp
Instances For
Returns a new empty build store.
Equations
Instances For
Atomic Mutable Reference #
A mutable reference to the Lake build store.
Equations
Instances For
Creates a new mutable build store.
Equations
Instances For
Atomically applies a pure modification to the build store.
Equations
- Lake.BuildStoreRef.modify f r = Std.Mutex.atomically r fun (x : ST.Ref IO.RealWorld Lake.BuildStore) => x.modify f
Instances For
Atomically applies a pure modification to the build store and returns the paired value.
Equations
- Lake.BuildStoreRef.modifyGet f r = Std.Mutex.atomically r fun (x : ST.Ref IO.RealWorld Lake.BuildStore) => x.modifyGet f
Instances For
Reads the current value of the build store, returning a snapshot of its state.
Equations
- r.get = Std.Mutex.atomically r fun (x : ST.Ref IO.RealWorld Lake.BuildStore) => x.get
Instances For
Atomically returns a projection of current value of the build store.
Equations
- Lake.BuildStoreRef.getMap f r = Std.Mutex.atomically r fun (ref : ST.Ref IO.RealWorld Lake.BuildStore) => do let __do_lift ← ref.get pure (f __do_lift)
Instances For
Atomically returns the build store's saved job for the build key k, if any.
Otherwise, returns none.
Equations
- Lake.BuildStoreRef.fetch? k r = Lake.BuildStoreRef.getMap (fun (s : Lake.BuildStore) => cast ⋯ (Std.DTreeMap.get? s k)) r
Instances For
Atomically inserts a new build job into the build store. Does nothing if one already exists.
Equations
- Lake.BuildStoreRef.store k v r = Lake.BuildStoreRef.modify (fun (x : Lake.BuildStore) => Std.DTreeMap.insertIfNew x k (cast ⋯ v)) r
Instances For
Returns the value of k in the store if it exists.
Otherwise, runs create to generate it, stores it, and returns the result.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Monadic Interaction #
Transformer to equip a monad with a mutable Lake build store.
An internal monad. Not intended for user use.
Equations
Instances For
-
Runs the monadic action x over the build store s,
returning the monadic result paired with the final state of the build store.
Equations
- Lake.BuildStoreT.run s x = do let ref ← liftM (Lake.BuildStoreRef.new s) let a ← ReaderT.run x ref let s ← liftM ref.get pure (a, s)
Instances For
Type class for monads equipped with a Lake build store.
Equations
- Lake.MonadBuildStore m = Lake.MonadDStore Lake.BuildKey (fun (x : Lake.BuildKey) => Lake.Job (Lake.BuildData x)) m
Instances For
Equations
- One or more equations did not get rendered due to their size.