Module System.Posix.Directory of the unix package defines
getWorkingDirectory :: IO FilePath
changeWorkingDirectory :: FilePath -> IO ()
I believe the functionality is quite portable and not limited to unix-like
systems. I know that e.g. Windows has chdir and getcwd. Module Filesystem of
the system-fileio package has