import Data.List (sortBy,sort)
import Data.Ord (comparing)
meansort xs = sortBy (comparing (abs . ((average xs)-))) (sort xs)
where
average xs = sum xs `div` (length xs)
import Data.List (sortBy,sort)
import Data.Ord (comparing)
meansort xs = sortBy (comparing (abs . ((average xs)-))) (sort xs)
where
average xs = sum xs `div` (length xs)