showOptClasses :: String
showOptClasses = "\n Optimization classes which can be passed to --opt:\n"
                 ++ (unlines $ map showOptClass optimizationClasses)
  where maxnamelength = max 10 (maximum $ map (length . fst) optimizationClasses)
        showOptClass (name, opts) = replicate (maxnamelength - length name) ' '
                                    ++ name ++ " : " ++ optlist opts
        optlist opts = prelines $ map (intercalate " ") $ intoFive opts
        prelines = intercalate ("\n   " ++ replicate maxnamelength ' ')
        intoFive :: [a] -> [[a]]
        intoFive list | null list = []
                      | length list < 5 = [list]
                      | otherwise = let (xs, ys) = splitAt 5 list
                                    in xs:(intoFive ys)
showOptClasses :: String
showOptClasses = "\n Optimization classes which can be passed to --opt:\n"
                 ++ (unlines $ map showOptClass optimizationClasses)
  where maxnamelength = max 10 (maximum $ map (length . fst) optimizationClasses)
        showOptClass (name, opts) = replicate (maxnamelength - length name) ' '
                                    ++ name ++ " : " ++ optlist opts
        optlist opts = prelines $ map (intercalate " ") $ intoFive opts
        prelines = intercalate ("\n   " ++ replicate maxnamelength ' ')
        intoFive :: [a] -> [[a]]
        intoFive list | null list = []
                      | length list < 5 = [list]
                      | otherwise = let (xs, ys) = splitAt 5 list
                                    in xs:(intoFive ys)
showOptClasses = "\n Optimization classes which can be passed to --opt:\n"
                 ++ (unlines $ map showOptClass optimizationClasses)
  where maxnamelength = max 10 (maximum $ map (length . fst) optimizationClasses)
        showOptClass (name, opts) = replicate (maxnamelength - length name) ' '
                                    ++ name ++ " : " ++ optlist opts
        optlist opts = prelines $ map (intercalate " ") $ intoFive opts
        prelines = intercalate ("\n   " ++ replicate maxnamelength ' ')
        intoFive :: [a] -> [[a]]
        intoFive list | null list = []
                      | length list < 5 = [list]
                      | otherwise = let (xs, ys) = splitAt 5 list
                                    in xs:(intoFive ys)