Skip to content

Commit 2f88861

Browse files
xperiandriclaude
andcommitted
refactor: the Tuple and Option modules of HashSet and ISet call the default modules by their short names
Each of these files opens `FSharp.Collections.Immutable`, and inside `FSharp.Collections.Immutable.Tuple.HashSet` the name `HashSet` reaches the default module, also for the functions that both modules define, so the full namespace in front of it added nothing. The compiled code is the same: the opcodes and the called methods of every method of both builds match one to one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent f36abd8 commit 2f88861

4 files changed

Lines changed: 8 additions & 13 deletions

File tree

‎src/FSharp.Collections.Immutable/HashSet/HashSetOption.fs‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ open FSharp.Collections.Immutable
88
// ---- Access ----
99

1010
[<CompiledName "TryGetValue">]
11-
let tryGetValue (value : 'T) (set : HashSet<'T>) =
12-
FSharp.Collections.Immutable.HashSet.tryGetValue value set
13-
|> ValueOption.toOption
11+
let tryGetValue (value : 'T) (set : HashSet<'T>) = HashSet.tryGetValue value set |> ValueOption.toOption
1412

1513
// ---- Transformation ----
1614

1715
[<CompiledName "Choose">]
18-
let choose (chooser : 'T -> 'U option) (set : HashSet<'T>) =
19-
FSharp.Collections.Immutable.HashSet.choose (fun item -> chooser item |> ValueOption.ofOption) set
16+
let choose (chooser : 'T -> 'U option) (set : HashSet<'T>) = HashSet.choose (fun item -> chooser item |> ValueOption.ofOption) set

‎src/FSharp.Collections.Immutable/HashSet/HashSetTuple.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ open FSharp.Collections.Immutable
99

1010
[<CompiledName "Partition">]
1111
let partition (predicate : 'T -> bool) (set : HashSet<'T>) =
12-
let struct (accepted, rejected) = FSharp.Collections.Immutable.HashSet.partition predicate set
12+
let struct (accepted, rejected) = HashSet.partition predicate set
1313
accepted, rejected
1414

1515
[<CompiledName "PartitionWith">]
1616
let partitionWith (partitioner : 'T -> Choice<'T1, 'T2>) (set : HashSet<'T>) =
17-
let struct (first, second) = FSharp.Collections.Immutable.HashSet.partitionWith partitioner set
17+
let struct (first, second) = HashSet.partitionWith partitioner set
1818
first, second

‎src/FSharp.Collections.Immutable/HashSet/ISetOption.fs‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ open FSharp.Collections.Immutable
99
// ---- Access ----
1010

1111
[<CompiledName "TryGetValue">]
12-
let tryGetValue (value : 'T) (set : IImmutableSet<'T>) =
13-
FSharp.Collections.Immutable.ISet.tryGetValue value set
14-
|> ValueOption.toOption
12+
let tryGetValue (value : 'T) (set : IImmutableSet<'T>) = ISet.tryGetValue value set |> ValueOption.toOption
1513

1614
// ---- Transformation ----
1715

1816
[<CompiledName "Choose">]
1917
let choose (chooser : 'T -> 'U option) (set : IImmutableSet<'T>) =
20-
FSharp.Collections.Immutable.ISet.choose (fun item -> chooser item |> ValueOption.ofOption) set
18+
ISet.choose (fun item -> chooser item |> ValueOption.ofOption) set

‎src/FSharp.Collections.Immutable/HashSet/ISetTuple.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ open FSharp.Collections.Immutable
1010

1111
[<CompiledName "Partition">]
1212
let partition (predicate : 'T -> bool) (set : IImmutableSet<'T>) =
13-
let struct (accepted, rejected) = FSharp.Collections.Immutable.ISet.partition predicate set
13+
let struct (accepted, rejected) = ISet.partition predicate set
1414
accepted, rejected
1515

1616
[<CompiledName "PartitionWith">]
1717
let partitionWith (partitioner : 'T -> Choice<'T1, 'T2>) (set : IImmutableSet<'T>) =
18-
let struct (first, second) = FSharp.Collections.Immutable.ISet.partitionWith partitioner set
18+
let struct (first, second) = ISet.partitionWith partitioner set
1919
first, second

0 commit comments

Comments
 (0)