Hacker News new | ask | show | jobs
by thinkpad20 4151 days ago
In my opinion it be nice to write it as a wrapper type thing:

    inDir d action = do
      oldDir <- pwd
      cd newDir
      result <- action
      cd oldDir
      return result
Then you could use it like a python `with` statement. :)