copyDirectory :: FilePath -> FilePath -> IO ()
copyDirectory from to = do
    xs <- getDirectoryContentsRecursive from
    forM_ xs $ \x -> do
        let dest = to ++ drop (length from) x
        createDirectoryIfMissing True $ takeDirectory dest
        copyFile x dest
copyDirectory :: FilePath -> FilePath -> IO ()
copyDirectory from to = do
    xs <- getDirectoryContentsRecursive from
    forM_ xs $ \x -> do
        let dest = to ++ drop (length from) x
        createDirectoryIfMissing True $ takeDirectory dest
        copyFile x dest
copyDirectory from to = do
    xs <- getDirectoryContentsRecursive from
    forM_ xs $ \x -> do
        let dest = to ++ drop (length from) x
        createDirectoryIfMissing True $ takeDirectory dest
        copyFile x dest