Skip to content

Commit 3cab26d

Browse files
committed
renamed to batchMap
1 parent 9c82dbc commit 3cab26d

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/FSharp.Data.Adaptive/AdaptiveHashMap/AdaptiveHashMap.fs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,9 @@ module AdaptiveHashMapImplementation =
756756

757757
HashMapDelta.ofHashMap changes
758758

759-
/// Reader for batchRecalc operations.
759+
/// Reader for batchMap operations.
760760
[<Sealed>]
761-
type BatchRecalculateDirty<'k, 'a, 'b>(input : amap<'k, 'a>, mapping : HashMap<'k,'a> -> HashMap<'k, aval<'b>>) =
761+
type BatchMap<'k, 'a, 'b>(input : amap<'k, 'a>, mapping : HashMap<'k,'a> -> HashMap<'k, aval<'b>>) =
762762
inherit AbstractReader<HashMapDelta<'k, 'b>>(HashMapDelta.empty)
763763

764764
let reader = input.GetReader()
@@ -1415,17 +1415,17 @@ module AMap =
14151415
else
14161416
create (fun () -> MapAReader(map, mapping))
14171417

1418-
/// Adaptively applies the given mapping to all changes and reapplies mapping on dirty outputs
1419-
let batchRecalcDirty (mapping: HashMap<'K, 'T1> -> HashMap<'K, aval<'T2>>) (map: amap<'K, 'T1>) =
1418+
/// Adaptively applies the given mapping to batches of all changes and reapplies mapping on dirty outputs
1419+
let batchMap (mapping: HashMap<'K, 'T1> -> HashMap<'K, aval<'T2>>) (map: amap<'K, 'T1>) =
14201420
if map.IsConstant then
14211421
let map = force map |> mapping
14221422
if map |> HashMap.forall (fun _ v -> v.IsConstant) then
14231423
constant (fun () -> map |> HashMap.map (fun _ v -> AVal.force v))
14241424
else
14251425
// TODO better impl possible
1426-
create (fun () -> BatchRecalculateDirty(ofHashMap map, id))
1426+
create (fun () -> BatchMap(ofHashMap map, id))
14271427
else
1428-
create (fun () -> BatchRecalculateDirty(map, mapping))
1428+
create (fun () -> BatchMap(map, mapping))
14291429

14301430

14311431
/// Adaptively chooses all elements returned by mapping.

src/FSharp.Data.Adaptive/AdaptiveHashMap/AdaptiveHashMap.fsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ module AMap =
105105
/// Adaptively applies the given mapping function to all elements and returns a new amap containing the results.
106106
val mapA : mapping: ('K -> 'V -> aval<'T>) -> map: amap<'K, 'V> -> amap<'K, 'T>
107107

108-
/// Adaptively applies the given mapping to all changes.
109-
val batchRecalcDirty : mapping: (HashMap<'K,'T1> -> HashMap<'K,aval<'T2>>) -> map: amap<'K, 'T1> -> amap<'K, 'T2>
108+
/// Adaptively applies the given mapping to batches of all changes and reapplies mapping on dirty outputs
109+
val batchMap : mapping: (HashMap<'K,'T1> -> HashMap<'K,aval<'T2>>) -> map: amap<'K, 'T1> -> amap<'K, 'T2>
110110

111111
/// Adaptively chooses all elements returned by mapping.
112112
val chooseA : mapping: ('K -> 'V -> aval<option<'T>>) -> map: amap<'K, 'V> -> amap<'K, 'T>

src/FSharp.Data.Adaptive/AdaptiveValue/AdaptiveValue.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ module AVal =
408408
/// Additionally fsproj files have dependencies, such as project.assets.json, that can't be determined until loaded with msbuild
409409
/// but should be reloaded if those dependent files change.
410410
/// </remarks>
411-
let mapWithAdditionalDependencies (mapping: 'a -> 'b * seq<#IAdaptiveValue>) (value: aval<'a>) : aval<'b> =
411+
let mapWithAdditionalDependencies (mapping: 'a -> 'b * #seq<#IAdaptiveValue>) (value: aval<'a>) : aval<'b> =
412412
let mutable lastDeps = HashSet.empty
413413

414414
{ new AbstractVal<'b>() with

src/FSharp.Data.Adaptive/AdaptiveValue/AdaptiveValue.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ module AVal =
116116
/// Additionally fsproj files have dependencies, such as project.assets.json, that can't be determined until loaded with msbuild
117117
/// but should be reloaded if those dependent files change.
118118
/// </remarks>
119-
val mapWithAdditionalDependencies : mapping :( 'T1 -> 'T2 * seq<#IAdaptiveValue>) -> value: aval<'T1> -> aval<'T2>
119+
val mapWithAdditionalDependencies : mapping :( 'T1 -> 'T2 * #seq<#IAdaptiveValue>) -> value: aval<'T1> -> aval<'T2>
120120

121121
/// Returns a new adaptive value that adaptively applies the mapping function to the given
122122
/// input and adaptively depends on the resulting adaptive value.

src/Test/FSharp.Data.Adaptive.Tests/AMap.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,11 @@ module AMap =
651651
>> HashMap.map(fun _ v ->
652652
AVal.constant v |> AVal.mapWithAdditionalDependencies (id)
653653
)
654-
AMap.batchRecalcDirty mapping map
654+
AMap.batchMap mapping map
655655

656656

657657
[<Test>]
658-
let ``[AMap] batchRecalcDirty``() =
658+
let ``[AMap] batchMap``() =
659659

660660
let file1 = "File1.fs"
661661
let file1Cval = cval 1

0 commit comments

Comments
 (0)