Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update Std -> Batteries #6

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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