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 =
466466 /// is strongly referenced elsewhere (backed by ConditionalWeakTable).
467467 ///
468468 /// Usage:
469- /// let getValueFor = WeakMap.getOrCreate (fun () -> expensiveInit() )
469+ /// let getValueFor = WeakMap.getOrCreate (fun key -> expensiveInit key )
470470 /// let v = getValueFor someKey
471471 let getOrCreate valueFactory =
472472 let table = ConditionalWeakTable<_, _>()
Original file line number Diff line number Diff line change @@ -297,9 +297,13 @@ module Async =
297297 val map : ( 'T -> 'U ) -> Async < 'T > -> Async < 'U >
298298
299299module 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
303307 val internal getOrCreate :
304308 valueFactory: ( 'Key -> 'Value) -> ( 'Key -> 'Value)
305309 when 'Key: not struct and 'Key : not null and 'Value : not struct
You can’t perform that action at this time.
0 commit comments