title: Changing directories in GHC Monad
body: <p>Looking at ghc package documentation i found this function:</p>
  <blockquote>
  <p><code>workingDirectoryChanged :: GhcMonad m =&gt; m ()</code></p>
  <p>Inform GHC that the working directory has changed. GHC will flush its cache of module locations, since it may no longer be valid.</p>
  <p>Note: Before changing the working directory make sure all threads running in the same session have stopped. If you change the working directory, you should also unload the current program (set targets to empty, followed by load).</p>
  </blockquote>
  <p>I need to run loaded code and compile expressions while changing directories. Is there any way/workaround to this?</p>
  <p>One solution i can think of is having separate directory, and setting workdir to that directory whenever interpreter is to be invoked, then restoring old pwd, but i'm not sure if it will work or if this is the best solution.</p>