Add type SampleReduceFunc, allow passing custom SampleReduceFunc in options