alertOlderVersions :: String -> Map.Map Version [FilePath] -> IO ()
alertOlderVersions appl m = when (not $ Map.null m) $ do
    _ <- readProcess "osascript" [] alert
    return ()
  where
    alert = "tell application \"" ++ appl ++ "\"\n\
            \\tactivate\n\
            \\tdisplay alert \"Older Versions\" message \"" ++ msg ++ "\"\n\
            \end tell\n"
    msg = "There are older versions of GHC and/or \
          \Haskell Platform on this system.\r\
          \\r\
          \Run the command line tool uninstall-hs to \
          \find out which and how to remove them."

-- | Remove file paths and associated other files.
-- Must be supplied the predicate used to select versions to remove so that the
-- associated files can be correctly identified.
alertOlderVersions :: String -> Map.Map Version [FilePath] -> IO ()
alertOlderVersions appl m = when (not $ Map.null m) $ do
    _ <- readProcess "osascript" [] alert
    return ()
  where
    alert = "tell application \"" ++ appl ++ "\"\n\
            \\tactivate\n\
            \\tdisplay alert \"Older Versions\" message \"" ++ msg ++ "\"\n\
            \end tell\n"
    msg = "There are older versions of GHC and/or \
          \Haskell Platform on this system.\r\
          \\r\
          \Run the command line tool uninstall-hs to \
          \find out which and how to remove them."

-- | Remove file paths and associated other files.
-- Must be supplied the predicate used to select versions to remove so that the
-- associated files can be correctly identified.
alertOlderVersions appl m = when (not $ Map.null m) $ do
    _ <- readProcess "osascript" [] alert
    return ()
  where
    alert = "tell application \"" ++ appl ++ "\"\n\
            \\tactivate\n\
            \\tdisplay alert \"Older Versions\" message \"" ++ msg ++ "\"\n\
            \end tell\n"
    msg = "There are older versions of GHC and/or \
          \Haskell Platform on this system.\r\
          \\r\
          \Run the command line tool uninstall-hs to \
          \find out which and how to remove them."

-- | Remove file paths and associated other files.
-- Must be supplied the predicate used to select versions to remove so that the
-- associated files can be correctly identified.