From 2d0ea16d6f334704a90dab8e207159219c2d8613 Mon Sep 17 00:00:00 2001 From: Magnus Madsen Date: Mon, 12 Oct 2026 21:48:36 +0200 Subject: [PATCH] docs: lock the declared dependencies in the Locking Effects chapter flix/flix#13503 made eff-lock and eff-check act on the dependencies the manifest declares, not on every installed package. The chapter's example project declared flix/museum-giftshop alone, so it no longer produced the transcripts shown. It now also declares flix/museum-clerk at 2.1.2, the version giftshop 2.0.2 pins, which reproduces every transcript byte for byte on a build of master at ccbd9b8. The preamble and the paragraph on what the lock covers say that it covers the declared dependencies and not the packages they depend on. Co-Authored-By: Claude Fable 5.1 --- src/locking-effects.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/locking-effects.md b/src/locking-effects.md index e163479..cfea442 100644 --- a/src/locking-effects.md +++ b/src/locking-effects.md @@ -10,7 +10,7 @@ change, we would have to read every public signature of every dependency again a every upgrade. Effect locking does this for us. The `eff-lock` command records the type and effect -signature of every public function of every package the project has installed in an +signature of every public function of every dependency the project declares in an `effects.lock` file, and the `eff-check` command tells us which of them have changed since. @@ -21,6 +21,7 @@ For a project that depends on: ```toml [dependencies] "github:flix/museum-giftshop" = { version = "2.0.2", mount = "giftshop" } +"github:flix/museum-clerk" = { version = "2.1.2", mount = "clerk" } ``` the `eff-lock` command type checks the project and reports: @@ -50,11 +51,8 @@ function's type and effect signature. The signatures that a trait declares go in The three functions here all have the signature `Unit -> Unit \ IO`, which is why they all have the same hash. -The lock covers every package the project has installed, not only the ones the -manifest declares: `flix/museum-clerk` is locked because `flix/museum-giftshop` -depends on it. The library bundled with Flix is not locked, since the `flix` field of -the manifest already fixes the version of Flix that provides it, and neither is our -own code. If the project does not type check, nothing is locked. +The lock covers the dependencies the manifest declares, and not the packages they +depend on: a package we do not declare is one we cannot call. > **Tip:** The `effects.lock` file should be committed to version control, like > `packages.lock`.