ghci and source files

Daniel Gorín dgorin at
Tue Jul 29 14:04:02 EDT 2008

On Jul 29, 2008, at 2:43 PM, Johannes Waldmann wrote:

> Hash: SHA1
>> data Target = Target TargetId (Maybe (StringBuffer,ClockTime))
> looks great. How is this intended to be used,
> i.e. what should happen if there is an "edit/save" event in the IDE?
> Then the IDE constructs a new StringBuffer from the buffer contents
> and sends it to the GHC API? (what call?)

IIRC,you first set (or add) targets (with GHC.setTargets or  
GHC.addTargets) and then run GHC.load indicating LoadAllTargets. I  
*think* it will chose to use the StringBuffer only if the ClockTime  
is newer than the file's timestamp. Thus, if the user updates and  
saves the file between the creation of the StringBuffer and the  
actual call to GHC.load, ghc will load the target from disk.

But I'm mostly guessing here, so you should probably try it out and  
see if it works  :)


More information about the Glasgow-haskell-users mailing list