pub fn constant_cost1<T>(cost: f64) -> impl FnMut(&T) -> f64