-- | Keep the alternatives of lowest rank.
filterSimplest :: [(TypeRank, [(Weight, DataPat c tc tv)])]
  -> (TypeRank, [(Weight, DataPat c tc tv)])
filterSimplest alts =
  let rank = minimum $ fst <$> alts
      alts' = snd <$> filter ((rank ==) . fst) alts
  in (rank, scaleWeights (1 % length alts') . concat $ alts')
filterSimplest :: [(TypeRank, [(Weight, DataPat c tc tv)])]
  -> (TypeRank, [(Weight, DataPat c tc tv)])
filterSimplest alts =
  let rank = minimum $ fst <$> alts
      alts' = snd <$> filter ((rank ==) . fst) alts
  in (rank, scaleWeights (1 % length alts') . concat $ alts')
filterSimplest alts =
  let rank = minimum $ fst <$> alts
      alts' = snd <$> filter ((rank ==) . fst) alts
  in (rank, scaleWeights (1 % length alts') . concat $ alts')