A more efficient implementation of 'make-sampler'