availablePackagesOnHackage :: IO Index
availablePackagesOnHackage = do
    putStrLn "Downloading Index ..."
    exists <- doesFileExist "data/index.tar"
    when (not exists) (void (do
        createDirectoryIfMissing True "data/"
        void (rawSystem "wget" [
            "-nv",
            "-O","data/index.tar.gz",
            "hackage.haskell.org/packages/index.tar.gz"])
        rawSystem "gunzip" ["-f","data/index.tar.gz"]))
    hackage <- readHackage' "data/index.tar"
    return (Map.map Map.keys hackage)
availablePackagesOnHackage :: IO Index
availablePackagesOnHackage = do
    putStrLn "Downloading Index ..."
    exists <- doesFileExist "data/index.tar"
    when (not exists) (void (do
        createDirectoryIfMissing True "data/"
        void (rawSystem "wget" [
            "-nv",
            "-O","data/index.tar.gz",
            "hackage.haskell.org/packages/index.tar.gz"])
        rawSystem "gunzip" ["-f","data/index.tar.gz"]))
    hackage <- readHackage' "data/index.tar"
    return (Map.map Map.keys hackage)
availablePackagesOnHackage = do
    putStrLn "Downloading Index ..."
    exists <- doesFileExist "data/index.tar"
    when (not exists) (void (do
        createDirectoryIfMissing True "data/"
        void (rawSystem "wget" [
            "-nv",
            "-O","data/index.tar.gz",
            "hackage.haskell.org/packages/index.tar.gz"])
        rawSystem "gunzip" ["-f","data/index.tar.gz"]))
    hackage <- readHackage' "data/index.tar"
    return (Map.map Map.keys hackage)