maximumsBy :: Ord b => (a -> b) -> [a] -> [a]
maximumsBy f = foldr g 
where g x  = [x]
g x ys = case f x `compare` f (head ys) of
LT -> ys
EQ -> x : ys
GT -> [x]
bestSeller :: (Ord b, Num b) => [a] -> [b] -> [b] -> [a]
bestSeller ns qs ps = map fst $ maximumsBy snd $
zip ns $ zipWith (*) qs ps
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.