id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
2406	Data.List.sortFun	lpsmith		"I've found these two functions useful often enough to suggest adding it to Data.List:

{{{
{-# RULES
       ""sortFun/fst""   forall .  sortFun fst = sortFun' fst
       ""sortFun/snd""   forall .  sortFun snd = sortFun' snd
 #-}

sortFun :: Ord b => (a -> b) -> [a] -> [a]
sortFun f  = map snd . sortFun' fst .  map (\x -> (f x, x))

sortFun' :: Ord b => (a -> b) -> [a] -> [a]
sortFun' f = Data.List.sortBy (\x y -> compare (f x) (f y))
}}}

I am not terribly fond of the name ""sortFun"".   If anybody has a better suggestion..."	feature request	closed	normal		libraries/base	6.8.3	wontfix			Unknown/Multiple	Unknown/Multiple		Unknown				
