groupOn :: (Ord a) => (b -> a) -> [b] -> [[b]]
groupOn toOrd = map snd . factor . sortBy (comparing fst) . map (toOrd &&& id)
groupOn :: (Ord a) => (b -> a) -> [b] -> [[b]]
groupOn toOrd = map snd . factor . sortBy (comparing fst) . map (toOrd &&& id)
groupOn toOrd = map snd . factor . sortBy (comparing fst) . map (toOrd &&& id)