25 Jan 2013 15:30
Fastest way to reload module with GHC API
JP Moresmau <jpmoresmau <at> gmail.com>
2013-01-25 14:30:49 GMT
2013-01-25 14:30:49 GMT
Hello, I just want to be sure of what's the fastest way to reload a module with the GHC API.
I have a file whose path is fp
I load the module with:
addTarget Target { targetId = TargetFile fp Nothing, targetAllowObjCode = True, targetContents = Nothing }
Then I load the module
load LoadAllTargets
And when I want to reload the module (the contents of fp have changed) I do:
removeTarget (TargetFile fp Nothing)
load LoadAllTargets
and then I rerun my initial code (addTarget, load)
This works well, I don't get any errors about duplicates, the information I extract from the module is updated properly. But is it the most efficient, or can I achieve the same thing faster (I'm looking at improving the performance of my BuildWrapper code and by consequence of EclipseFP)?
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users <at> haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
RSS Feed