Documentation

Lean.EnvExtension

Further environment extension API; the primitives live in Lean.Environment.

Simple PersistentEnvExtension that implements exportEntriesFn using a list of entries.

Equations
Instances For
    @[specialize #[]]
    def Lean.mkStateFromImportedEntries {α σ : Type} (addEntryFn : σ → α → σ) (initState : σ) (as : Array (Array α)) :
    σ
    Equations
    Instances For
      Instances For
        def Lean.SimplePersistentEnvExtension.replayOfFilter {σ : Type u_1} {α : Type u_2} (p : σ → α → Bool) (addEntryFn : σ → α → σ) :
        List α → σ → σ → List α × σ

        Returns a function suitable for SimplePersistentEnvExtensionDescr.replay? that replays all new entries onto the state using addEntryFn. p should filter out entries that have already been added to the state by a prior replay of the same realizable constant.

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

            Get the list of values used to update the state of the given SimplePersistentEnvExtension in the current file.

            Equations
            Instances For

              Get the current state of the given SimplePersistentEnvExtension.

              Equations
              Instances For

                Set the current state of the given SimplePersistentEnvExtension. This change is not persisted across files.

                Equations
                Instances For

                  Modify the state of the given extension in the given environment by applying the given function. This change is not persisted across files.

                  Equations
                  Instances For
                    def Lean.findSortedByName? {α : Type u_1} (entries : Array (Name × α)) (declName : Name) :

                    entries.binSearch (declName, default) (fun a b => Name.quickLt a.1 b.1) with the same probes, but comparing the names directly: one Name.quickCmp per probe instead of up to two calls of a closure. The USize cutoff keeps lo + hi below USize.size, including on 32-bit platforms.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Lean.findByName? {α : Type u_1} (entries : Array (Name × α)) (declName : Name) :

                      entries.find? (·.1 == declName), without calling a closure on each entry.

                      Equations
                      Instances For
                        def Lean.containsSortedName (names : Array Name) (declName : Name) :

                        names.binSearchContains declName Name.quickLt, comparing as findSortedByName? does.

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

                          Environment extension for tagging declarations. Declarations must only be tagged in the module where they were declared.

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

                                  Environment extension for mapping declarations to values. Declarations must only be inserted into the mapping in the module where they were declared.

                                  Instances For
                                    def Lean.mkMapDeclarationExtension {α : Type} (name : Name := by exact decl_name%) (asyncMode : EnvExtension.AsyncMode := EnvExtension.AsyncMode.async AsyncBranch.mainEnv) (logWrites : Bool := false) (exportEntriesFn : Environment → NameMap α → OLeanEntries (Array (Name × α)) := fun (env : Environment) (s : NameMap α) => have all := Array.filter (fun (x : Name × α) => match x with | (n, snd) => env.contains n false) (Std.TreeMap.toArray s); have exported := Array.filter (fun (x : Name × α) => match x with | (n, snd) => (env.setExporting true).contains n false) all; { exported := exported, server := exported, «private» := all }) :
                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      def Lean.MapDeclarationExtension.insert {α : Type} (ext : MapDeclarationExtension α) (env : Environment) (declName : Name) (val : α) (allowOverwrite : Bool := false) :

                                      Adds the entry for declName. Entries are write-once: facts derived from an entry, such as cached type class resolution results, assume it never changes. allowOverwrite permits replacing an existing entry, which invalidates such facts; use it only where that is justified, and say why.

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