-- Take the product of weights.
combine :: ([a] -> b) -> [(Weight, a)] -> (Weight, b)
combine f was =
  let (ws, as) = unzip was
  in (product ws, f as)
combine :: ([a] -> b) -> [(Weight, a)] -> (Weight, b)
combine f was =
  let (ws, as) = unzip was
  in (product ws, f as)
combine f was =
  let (ws, as) = unzip was
  in (product ws, f as)