Documentation

Lake.Config.Monad

Lake Configuration Monads #

Definitions and helpers for interacting with the Lake configuration monads.

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

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

Equations
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.

    Equations
    Instances For
      @[inline]
      def Lake.LakeEnvT.run {m : TypeType u_1} {α : Type} (env : Env) (self : LakeEnvT m α) :
      m α
      Equations
      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.

          Equations
          Instances For
            @[inline]

            Make a Lake.Context from a Workspace.

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

              Run a LakeT monad in the context of this workspace.

              Equations
              Instances For
                @[inline]
                Equations
                Instances For

                  Workspace Helpers #

                  @[inline]

                  Get the root package of the context's workspace.

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

                    Try to find a package within the workspace with the given name.

                    Equations
                    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.

                      Equations
                      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.

                        Equations
                        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.

                          Equations
                          Instances For
                            @[inline]

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

                            Equations
                            Instances For
                              @[inline]

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

                              Equations
                              Instances For
                                @[inline]

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

                                Equations
                                Instances For
                                  @[inline]

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

                                  Equations
                                  Instances For
                                    @[inline]

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

                                    Equations
                                    Instances For
                                      @[inline]

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

                                      Equations
                                      Instances For
                                        @[inline]

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

                                        Equations
                                        Instances For
                                          @[inline]

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

                                          Equations
                                          Instances For

                                            Environment Helpers #

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

                                            Gets the current Lake environment.

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

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

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

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

                                                Equations
                                                Instances For
                                                  @[inline]

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

                                                  Equations
                                                  Instances For
                                                    @[inline]

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

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

                                                      Returns the Lake cache for the environment. May be disabled.

                                                      Equations
                                                      Instances For
                                                        @[inline]
                                                        def Lake.getArtifact? {m : TypeType u_1} [MonadLakeEnv m] [Bind m] [MonadLiftT BaseIO m] (contentHash : Hash) (ext : String := "art") :

                                                        Returns the path to the artifact in the Lake cache with extension ext if it exists.

                                                        If the Lake cache is disabled, the behavior of this function is undefined.

                                                        Equations
                                                        Instances For

                                                          Search Path Helpers #

                                                          @[inline]

                                                          Get the detected LEAN_PATH value of the Lake environment.

                                                          Equations
                                                          Instances For
                                                            @[inline]

                                                            Get the detected LEAN_SRC_PATH value of the Lake environment.

                                                            Equations
                                                            Instances For
                                                              @[inline]

                                                              Get the detected sharedLibPathEnvVar value of the Lake environment.

                                                              Equations
                                                              Instances For

                                                                Elan Install Helpers #

                                                                @[inline]

                                                                Get the detected Elan installation (if one).

                                                                Equations
                                                                Instances For
                                                                  @[inline]

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

                                                                  Equations
                                                                  Instances For
                                                                    @[inline]

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

                                                                    Equations
                                                                    Instances For

                                                                      Lean Install Helpers #

                                                                      @[inline]

                                                                      Get the detected Lean installation.

                                                                      Equations
                                                                      Instances For
                                                                        @[inline]

                                                                        Get the root directory of the detected Lean installation.

                                                                        Equations
                                                                        Instances For
                                                                          @[inline]

                                                                          Get the Lean source directory of the detected Lean installation.

                                                                          Equations
                                                                          Instances For
                                                                            @[inline]

                                                                            Get the Lean library directory of the detected Lean installation.

                                                                            Equations
                                                                            Instances For
                                                                              @[inline]

                                                                              Get the C include directory of the detected Lean installation.

                                                                              Equations
                                                                              Instances For
                                                                                @[inline]

                                                                                Get the system library directory of the detected Lean installation.

                                                                                Equations
                                                                                Instances For
                                                                                  @[inline]

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

                                                                                  Equations
                                                                                  Instances For
                                                                                    @[inline]

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

                                                                                    Equations
                                                                                    Instances For
                                                                                      @[inline]

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

                                                                                      Equations
                                                                                      Instances For
                                                                                        @[inline]

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

                                                                                        Equations
                                                                                        Instances For
                                                                                          @[inline]

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

                                                                                          Equations
                                                                                          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.

                                                                                            Equations
                                                                                            Instances For
                                                                                              @[inline]

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

                                                                                              Equations
                                                                                              Instances For

                                                                                                Lake Install Helpers #

                                                                                                @[inline]

                                                                                                Get the detected Lake installation.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[inline]

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

                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    @[inline]

                                                                                                    Get the source directory of the detected Lake installation.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[inline]

                                                                                                      Get the Lean library directory of the detected Lake installation.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[inline]

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

                                                                                                        Equations
                                                                                                        Instances For