memo f
is similar to Core.Memo.general (fun k -> shared (f k))
. The
important difference is that the memo entry is only kept while the resource is
acquired. In particular, once all handles of a particular key get released the memo
entry gets forgotten and f
gets applied again on next acquisition. If acquire
fails or function raises for a particular key, the result is not cached.