Documentation

Lake.Config.Monad

@[reducible, inline]
abbrev Lake.MonadLakeEnv (m : TypeType u) :

A monad equipped with a (read-only) detected environment for Lake.

Instances For
    @[reducible, inline]
    abbrev Lake.LakeEnvT (m : TypeType u_1) (α : Type) :
    Type u_1

    A transformer to equip a monad with a Lake.Env.

    Instances For
      @[inline]
      def Lake.LakeEnvT.run {m : TypeType u_1} {α : Type} (env : Env) (self : LakeEnvT m α) :
      m α
      Instances For
        class Lake.MonadWorkspace (m : TypeType u) :

        A monad equipped with a (read-only) Lake Workspace.

        • getWorkspace : m Workspace

          Gets the current Lake workspace.

        Instances
          @[reducible, inline]
          abbrev Lake.MonadLake (m : TypeType u) :

          A monad equipped with a (read-only) Lake context.

          Instances For
            @[inline]

            Constructs a Lake.Context from the workspace ws.

            Instances For
              @[inline]
              def Lake.Workspace.runLakeT {m : TypeType u_1} {α : Type} (ws : Workspace) (x : LakeT m α) :
              m α

              Runs a LakeT monad in the context of the workspace ws.

              Instances For
                @[implicit_reducible]
                @[inline]
                Instances For
                  @[implicit_reducible]
                  @[inline]

                  Returns the root package of the context's workspace.

                  Instances For
                    @[inline]
                    def Lake.findPackageByKey? {m : TypeType u_1} [MonadWorkspace m] [Functor m] (keyName : Lean.Name) :
                    m (Option (NPackage keyName))

                    Returns the unique package in the workspace (if any) that is identified by keyName.

                    Instances For
                      @[inline]

                      Returns the first package in the workspace (if any) that has been assigned the name.

                      This can be used to find the package corresponding to a user-provided name. If the package's unique identifier is already available, use findPackageByKey?instead.

                      Instances For
                        @[reducible, inline, deprecated "Use `findPackageByKey?` or `findPackageByName?` instead" (since := "2025-12-03")]
                        abbrev Lake.findPackage? {m : TypeType u_1} [MonadWorkspace m] [Functor m] (name : Lean.Name) :
                        m (Option (NPackage name))

                        Deprecated. If attempting to find the package corresponding to a user-provided name, use findPackageByName?. Otherwise, if the package's unique identifier is available, use findPackageByKey?.

                        Instances For
                          @[inline]
                          def Lake.findModule? {m : TypeType u_1} [MonadWorkspace m] [Functor m] (name : Lean.Name) :

                          Locate the named, buildable, importable, local module in the workspace.

                          Instances For
                            @[inline]
                            def Lake.findModules {m : TypeType u_1} [MonadWorkspace m] [Functor m] (name : Lean.Name) :

                            For each package in the workspace, locate the named, buildable, importable, local module.

                            Instances For
                              @[inline]

                              Returns the buildable module in the workspace whose source file is path.

                              Instances For
                                @[inline]
                                def Lake.findLeanExe? {m : TypeType u_1} [MonadWorkspace m] [Functor m] (name : Lean.Name) :

                                Try to find a Lean executable in the workspace with the given name.

                                Instances For
                                  @[inline]
                                  def Lake.findLeanLib? {m : TypeType u_1} [MonadWorkspace m] [Functor m] (name : Lean.Name) :

                                  Try to find a Lean library in the workspace with the given name.

                                  Instances For
                                    @[inline]

                                    Try to find an external library in the workspace with the given name.

                                    Instances For
                                      @[inline]

                                      Options to pass to the Lean server when editing Lean files outside a library.

                                      Instances For
                                        @[inline]

                                        Options to pass to lean for files outside a library (e.g., via lake lean).

                                        Instances For
                                          @[inline]

                                          Arguments to pass to lean for files outside a library (e.g., via lake lean).

                                          Instances For
                                            @[inline]

                                            Returns the paths added to LEAN_PATH by the context's workspace.

                                            Instances For
                                              @[inline]

                                              Returns the paths added to LEAN_SRC_PATH by the context's workspace.

                                              Instances For
                                                @[inline]

                                                Returns the paths added to the shared library path by the context's workspace.

                                                Instances For
                                                  @[inline]

                                                  Returns the augmented LEAN_PATH set by the context's workspace.

                                                  Instances For
                                                    @[inline]

                                                    Returns the augmented LEAN_SRC_PATH set by the context's workspace.

                                                    Instances For
                                                      @[inline]

                                                      Returns the augmented shared library path set by the context's workspace.

                                                      Instances For
                                                        @[inline]

                                                        Returns the augmented environment variables set by the context's workspace.

                                                        Instances For
                                                          @[inline]
                                                          def Lake.getLakeCache {m : TypeType u_1} [MonadWorkspace m] [Functor m] :

                                                          Returns the Lake cache for the environment.

                                                          Instances For
                                                            @[inline]

                                                            Returns the artifact in the Lake cache corresponding the given artifact description.

                                                            Instances For
                                                              @[inline]

                                                              Returns whether the package should store its artifacts in the Lake artifact cache.

                                                              If the package has not configured the artifact cache itself through Package.enableArtifactCache?, this will default to the workspace configuration.

                                                              Instances For
                                                                @[inline]

                                                                Returns whether the package should restore its artifacts from the Lake artifact cache.

                                                                If the package has not configured the artifact cache itself through Package.enableArtifactCache?, this will default to the workspace configuration.

                                                                Instances For
                                                                  @[reducible, inline, deprecated Lake.Package.isArtifactCacheWritable (since := "2026-02-03")]

                                                                  Returns whether the package should restore its artifacts from the Lake artifact cache.

                                                                  If the package has not configured the artifact cache itself through Package.enableArtifactCache?, this will default to the workspace configuration.

                                                                  Instances For
                                                                    @[inline]
                                                                    def Lake.getLakeEnv {m : TypeType u_1} [MonadLakeEnv m] :
                                                                    m Env

                                                                    Gets the current Lake environment.

                                                                    Instances For
                                                                      @[inline]
                                                                      def Lake.getNoCache {m : TypeType u_1} [MonadLakeEnv m] [Functor m] [MonadBuild m] :

                                                                      Returns the LAKE_NO_CACHE/--no-cache Lake configuration.

                                                                      Instances For
                                                                        @[inline]
                                                                        def Lake.getTryCache {m : TypeType u_1} [MonadLakeEnv m] [Functor m] [MonadBuild m] :

                                                                        Returns whether the LAKE_NO_CACHE/--no-cache Lake configuration is NOT set.

                                                                        Instances For
                                                                          @[inline]

                                                                          Returns the LAKE_PACKAGE_URL_MAP for the Lake environment. Empty if none.

                                                                          Instances For
                                                                            @[inline]

                                                                            Returns the name of Elan toolchain for the Lake environment. Empty if none.

                                                                            Instances For
                                                                              @[inline]

                                                                              Returns the detected LEAN_PATH value of the Lake environment.

                                                                              Instances For
                                                                                @[inline]

                                                                                Returns the detected LEAN_SRC_PATH value of the Lake environment.

                                                                                Instances For
                                                                                  @[inline]

                                                                                  Returns the detected sharedLibPathEnvVar value of the Lake environment.

                                                                                  Instances For
                                                                                    @[inline]

                                                                                    Returns the detected Elan installation (if one).

                                                                                    Instances For
                                                                                      @[inline]

                                                                                      Returns the root directory of the detected Elan installation (i.e., ELAN_HOME).

                                                                                      Instances For
                                                                                        @[inline]

                                                                                        Returns the path of the elan binary in the detected Elan installation.

                                                                                        Instances For
                                                                                          @[inline]

                                                                                          Returns the detected Lean installation.

                                                                                          Instances For
                                                                                            @[inline]

                                                                                            Returns the root directory of the detected Lean installation.

                                                                                            Instances For
                                                                                              @[inline]

                                                                                              Returns the Lean source directory of the detected Lean installation.

                                                                                              Instances For
                                                                                                @[inline]

                                                                                                Returns the Lean library directory of the detected Lean installation.

                                                                                                Instances For
                                                                                                  @[inline]

                                                                                                  Returns the C include directory of the detected Lean installation.

                                                                                                  Instances For
                                                                                                    @[inline]

                                                                                                    Returns the system library directory of the detected Lean installation.

                                                                                                    Instances For
                                                                                                      @[inline]

                                                                                                      Returns the path of the lean binary in the detected Lean installation.

                                                                                                      Instances For
                                                                                                        @[inline]

                                                                                                        Returns the path of the leanc binary in the detected Lean installation.

                                                                                                        Instances For
                                                                                                          @[inline]

                                                                                                          Returns the path of the libleanshared library in the detected Lean installation.

                                                                                                          Instances For
                                                                                                            @[inline]

                                                                                                            Get the path of the ar binary in the detected Lean installation.

                                                                                                            Instances For
                                                                                                              @[inline]

                                                                                                              Get the path of C compiler in the detected Lean installation.

                                                                                                              Instances For
                                                                                                                @[inline]
                                                                                                                def Lake.getLeanCc? {m : TypeType u_1} [MonadLakeEnv m] [Functor m] :

                                                                                                                Get the optional LEAN_CC compiler override of the detected Lean installation.

                                                                                                                Instances For
                                                                                                                  @[inline]

                                                                                                                  Get the flags required to link shared libraries using the detected Lean installation.

                                                                                                                  Instances For
                                                                                                                    @[inline]

                                                                                                                    Get the detected Lake installation.

                                                                                                                    Instances For
                                                                                                                      @[inline]

                                                                                                                      Get the root directory of the detected Lake installation (e.g., LAKE_HOME).

                                                                                                                      Instances For
                                                                                                                        @[inline]

                                                                                                                        Get the source directory of the detected Lake installation.

                                                                                                                        Instances For
                                                                                                                          @[inline]

                                                                                                                          Get the Lean library directory of the detected Lake installation.

                                                                                                                          Instances For
                                                                                                                            @[inline]

                                                                                                                            Get the path of the lake binary in the detected Lake installation.

                                                                                                                            Instances For