jackfirth / racket-disposable

An experimental Racket library providing an abstraction for values associated with external resources that allows automatic resource pooling, per-thread virtual construction, and monadic composition
Apache License 2.0
7 stars 0 forks source link

Add disposable memoization #96

Closed jackfirth closed 7 years ago

jackfirth commented 7 years ago

Memoization is when a function "remembers" what it returns when called and reuses that result in future calls with the same arguments. This can be extended to disposables to convert a function that returns a disposable into a disposable of a function that returns an allocated value. Useful for memoizing functions that return things like database connections.