Documentation

ImportGraph.Lake

Allows iteration over the modules (any *.lean file) under dir via for (mod, dirEntry) in mods do. Usually invoked via for (mod, dirEntry) in dir.modules do; see ImportGraph.System.FilePath.modules for details.

Instances For
    @[inline]

    Allows iteration over the modules (any *.lean file) under dir via for (mod, dirEntry) in dir.modules do, descending into subdirectories (top-down, left-to-right), and constructing the module name according to the directory names and *.lean filenames.

    For example, if dir contains A/B/C.lean, this iteration visits (A.B.C, ⟨"A/B", "C.lean"⟩).

    If root is provided, then root is prepended to the module names created from paths in the directory, e.g. if dir contains A/B/C.lean and we iterate through for (mod, dirEntry) in dir.modules (root := `Foo), this iteration visits (Foo.A.B.C, ⟨"A/B", "C.lean"⟩).

    By default, no root is inferred.

    Equations
    Instances For
      @[specialize #[]]
      partial def ImportGraph.System.FilePath.Modules.forInAux {m : Type → Type u_1} [Monad m] [MonadLiftT IO m] {β : Type} (dir : System.FilePath) (pre : Lean.Name) (b : β) (f : Lean.Name × IO.FS.DirEntry → β → m (ForInStep β)) :
      m (ForInStep β)
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      Splits path into the DirEntry for its enclosing directory and file name, as readDir would report it. path.parent (rather than path.withFileName "") is used for root so that it carries no trailing separator and so that root / fileName round-trips back to path (matching the entries produced when iterating through a directory).

      Equations
      Instances For

        Missing instances #

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          for ... in instances #

          Allows iteration over the matched modules via for (mod, dirEntry) in globMods do. This is typically constructed via glob.modulesIn dir.

          Instances For
            @[inline]

            Allows iteration over the modules matched by a Lake.Glob in dir via for (mod, dirEntry) in glob.modulesIn dir do.

            Equations
            Instances For
              @[specialize #[]]
              def ImportGraph.Lake.Glob.Modules.forIn {m : Type → Type u_1} [Monad m] [MonadLiftT IO m] {β : Type} (spec : Modules) (init : β) (f : Lean.Name × IO.FS.DirEntry → β → m (ForInStep β)) :
              m β

              Iterates over the module names selected by glob, resolving submodule globs against the .lean files found under dir.

              Auxiliary to the ForIn instance for Glob.Modules.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Loads the lake workspace from the current directory (or, if specified, from wsDir?) in IO.

                Note that in the language server, the current working directory is the workspace root, so this may use the current working directory of elaboration. However, it may not itself be called directly during elaboration, as this causes the language server to crash. Therefore, for use "in" the language server, it must be called across a process boundary via an exe.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For