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 sugar for allocating N copies of a disposable #91

Open jackfirth opened 7 years ago

jackfirth commented 7 years ago

Using disposable-apply with list to do this is cumbersome, but using it with make-list is subtly wrong: only one value will be allocated and the list will contain that value repeated N times. A simple disposable-repeat procedure would be nice to have.

Use case that spawned this idea is a disposable worker place used in a command line tool where users can control the number of workers with a flag.