3 ms·
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 oldDi
by thinkpad20 12y 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. :)