-- http://www.codewars.com/kata/5467e4d82edf8bbf40000155
module DescendingOrder where

import Data.List

descendingOrder :: Integer -> Integer
descendingOrder = foldl (\acc n -> acc * 10 + n) 0 . sortBy (flip compare) . map (`mod`10) . takeWhile (>0) . iterate (`div`10)
