module Part1 ( parseFileString, quickSort, ) where split :: [Int] -> ([Int], [Int]) split mylist = case mylist of [] -> ([], []) x : xs -> let (evens, odds) = split xs in (x : odds, evens) parseFileString :: String -> ([Int], [Int]) parseFileString file_string = split parsed_word_list where parsed_word_list = [read word :: Int | word <- words file_string] quickSort :: [Int] -> [Int] quickSort [] = [] quickSort (x : xs) = smallerSorted ++ [x] ++ biggerSorted where smallerSorted = quickSort [a | a <- xs, a <= x] biggerSorted = quickSort [a | a <- xs, a > x]