File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -466,7 +466,7 @@ module WeakMap =
466
466
/// is strongly referenced elsewhere (backed by ConditionalWeakTable).
467
467
///
468
468
/// Usage:
469
- /// let getValueFor = WeakMap.getOrCreate (fun () -> expensiveInit() )
469
+ /// let getValueFor = WeakMap.getOrCreate (fun key -> expensiveInit key )
470
470
/// let v = getValueFor someKey
471
471
let getOrCreate valueFactory =
472
472
let table = ConditionalWeakTable<_, _>()
Original file line number Diff line number Diff line change @@ -297,9 +297,13 @@ module Async =
297
297
val map : ( 'T -> 'U ) -> Async < 'T > -> Async < 'U >
298
298
299
299
module internal WeakMap =
300
- /// Attach a value to arbitrary keys using a ConditionalWeakTable.
301
- /// Each distinct key gets its own value produced by createValue().
302
- /// The value is lazily created and stays alive only as long as the key is strongly referenced elsewhere.
300
+ /// Provides association of lazily-created values with arbitrary key objects.
301
+ /// The associated value is created on first request and kept alive only while the key
302
+ /// is strongly referenced elsewhere (backed by ConditionalWeakTable).
303
+ ///
304
+ /// Usage:
305
+ /// let getValueFor = WeakMap.getOrCreate (fun key -> expensiveInit key)
306
+ /// let v = getValueFor someKey
303
307
val internal getOrCreate :
304
308
valueFactory: ( 'Key -> 'Value) -> ( 'Key -> 'Value)
305
309
when 'Key: not struct and 'Key : not null and 'Value : not struct
You can’t perform that action at this time.
0 commit comments