1 module Main where
    2 
    3 import Sort
    4 
    5 main = do
    6     cs <- getContents
    7     putStr (mangle "quickSort" cs)
    8 
    9 mangle :: String{-opt-} -> String{-input to sort-} -> String{-output-}
   10 mangle opt inpt
   11   = (unlines . sort . lines) inpt
   12   where
   13     sort = case opt of
   14              "heapSort"               -> heapSort
   15              "insertSort"      -> insertSort
   16              "mergeSort"       -> mergeSort
   17              "quickSort"       -> quickSort
   18              "quickSort2"      -> quickSort2
   19              "quickerSort"     -> quickerSort
   20              "treeSort"               -> treeSort
   21              "treeSort2"       -> treeSort2
   22              _ -> error ("unrecognized opt: "++opt++"\n")