Skip to content

Commit

Permalink
chore: some NameSet API has been upstreamed
Browse files Browse the repository at this point in the history
  • Loading branch information
grunweg committed Jan 9, 2025
1 parent 4f369e5 commit 8537807
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
23 changes: 1 addition & 22 deletions ImportGraph/RequiredModules.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,7 @@ import Lean.CoreM
import Lean.Data.NameMap
import Lean.Environment
import Lean.Util.FoldConsts

namespace Lean.NameSet

instance : Singleton Name NameSet where
singleton := fun n => (∅ : NameSet).insert n

instance : Union NameSet where
union := fun s t => s.fold (fun t n => t.insert n) t

instance : Inter NameSet where
inter := fun s t => s.fold (fun r n => if t.contains n then r.insert n else r) {}

instance : SDiff NameSet where
sdiff := fun s t => t.fold (fun s n => s.erase n) s

def ofList (l : List Name) : NameSet :=
l.foldl (fun s n => s.insert n) {}

def ofArray (a : Array Name) : NameSet :=
a.foldl (fun s n => s.insert n) {}

end Lean.NameSet
import Batteries.Data.NameSet

namespace Lean

Expand Down
4 changes: 2 additions & 2 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "8ce422eb59adf557fac184f8b1678c75fa03075c",
"rev": "66225aab4f6bd1687053b03916105f7cab140507",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.16.0-rc1",
"inputRev": "main",
"inherited": false,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover/lean4-cli",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rev = "main"
[[require]]
name = "batteries"
scope = "leanprover-community"
rev = "v4.16.0-rc1"
rev = "main"

[[lean_lib]]
name = "ImportGraph"
Expand Down

0 comments on commit 8537807

Please sign in to comment.