Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/nofib/spectral/sorting/Main.hs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Main where

import Sort

main = do
    cs <- getContents
    putStr (mangle "quickSort" cs)

mangle :: String{-opt-} -> String{-input to sort-} -> String{-output-}
mangle opt inpt
  = (unlines . sort . lines) inpt
  where
    sort = case opt of
	     "heapSort"		-> heapSort
	     "insertSort"	-> insertSort
	     "mergeSort"	-> mergeSort
	     "quickSort"	-> quickSort
	     "quickSort2"	-> quickSort2
	     "quickerSort"	-> quickerSort
	     "treeSort"		-> treeSort
	     "treeSort2"	-> treeSort2
	     _ -> error ("unrecognized opt: "++opt++"\n")

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].