Skip to content

Commit

Permalink
Merge pull request #6 from leanprover-community/batteries
Browse files Browse the repository at this point in the history
chore: update Std -> Batteries
  • Loading branch information
kim-em authored May 7, 2024
2 parents 7cec593 + c28209a commit c46d22b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ImportGraph/Cli.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import Cli.Basic
import Std.Lean.IO.Process
import Std.Lean.Util.Path
import Batteries.Lean.IO.Process
import Batteries.Lean.Util.Path
import ImportGraph.CurrentModule
import ImportGraph.Imports
import ImportGraph.Lean.Name
Expand Down
2 changes: 1 addition & 1 deletion ImportGraph/Imports.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Scott Morrison
-/
import Lean
import Std.Lean.NameMap
import Batteries.Lean.NameMap
import ImportGraph.RequiredModules

/-!
Expand Down
15 changes: 7 additions & 8 deletions ImportGraph/Lean/Name.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ Authors: Jon Eugster
-/
import Lean.Data.Name
import Lean.CoreM
import Std.Data.HashMap.Basic
import Std.Lean.Name
import Std.Lean.SMap
import Batteries.Data.HashMap.Basic
import Batteries.Lean.Name
import Batteries.Lean.SMap
import Lean.Meta.Match.MatcherInfo

/-!
TODO: Some declarations in this file are duplicated from mathlib, but especially `isBlacklisted`
is deemed to specific for upstreaming to Std.
is deemed to specific for upstreaming to Batteries.
-/
namespace Lean.Name

open Lean Meta Elab
open Std

namespace ImportGraph

Expand Down Expand Up @@ -48,11 +47,11 @@ gathered together into a `HashMap` according to the module they are defined in.
Note: copied from `Mathlib.Lean.Name`
-/
def allNamesByModule (p : Name → Bool) : CoreM (Std.HashMap Name (Array Name)) := do
(← getEnv).constants.foldM (init := Std.HashMap.empty) fun names n _ => do
def allNamesByModule (p : Name → Bool) : CoreM (Batteries.HashMap Name (Array Name)) := do
(← getEnv).constants.foldM (init := Batteries.HashMap.empty) fun names n _ => do
if p n && !(← isBlackListed n) then
let some m ← findModuleOf? n | return names
-- TODO use `Std.HashMap.modify` when we bump Std4 (or `alter` if that is written).
-- TODO use `Batteries.HashMap.modify` when we bump `batteries` (or `alter` if that is written).
match names.find? m with
| some others => return names.insert m (others.push n)
| none => return names.insert m #[n]
Expand Down
6 changes: 3 additions & 3 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"inputRev": "main",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover/std4",
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"rev": "3025cb124492b423070f20cf0a70636f757d117f",
"name": "std",
"rev": "56d2e4ee226603eb6b90b05f6b944bde42672cd5",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": false,
Expand Down
4 changes: 2 additions & 2 deletions lakefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ git = "https://github.com/leanprover/lean4-cli"
rev = "main"

[[require]]
name = "std"
git = "https://github.com/leanprover/std4"
name = "batteries"
git = "https://github.com/leanprover-community/batteries"
rev = "main"

[[lean_lib]]
Expand Down

0 comments on commit c46d22b

Please sign in to comment.