Re: [Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-21 Thread Hongmin Fan
This is so weird, if I wait long enough it works, but if I press enter fast enough, still get the wrong answer. On Wed, Jul 21, 2010 at 2:34 PM, Albert Y.C.Lai wrote: > Try adding more delay between the two loadings, e.g., make me press enter, > and hope I am not faster than a computer: > > main

Re: [Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-21 Thread Hongmin Fan
Thanks! hint works good! On Tue, Jul 20, 2010 at 9:29 PM, Andy Stewart wrote: > Hongmin Fan writes: > > > Thanks Andy! Yes, I do need the second approach you listed here. I think > the plugin package actually > > uses GHC API to load > > too. > > > > My problem here is more technical than theore

[Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-21 Thread Albert Y . C . Lai
Try adding more delay between the two loadings, e.g., make me press enter, and hope I am not faster than a computer: main = do     writeTarget "arg"     func0 <- compileTarget     putStrLn $ show $ func0 2 getLine     writeTarget "arg*2"     func1 <- compileTarget     putStrLn $ show $ func1

Re: [Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-20 Thread Andy Stewart
Hongmin Fan writes: > Thanks Andy! Yes, I do need the second approach you listed here. I think the > plugin package actually > uses GHC API to load > too. > > My problem here is more technical than theoretical. The type safety isn't the > primary issue for me, > because I'm trying to > implemen

Re: [Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-20 Thread Hongmin Fan
Thanks Andy! Yes, I do need the second approach you listed here. I think the plugin package actually uses GHC API to load too. My problem here is more technical than theoretical. The type safety isn't the primary issue for me, because I'm trying to implement a certain genetic programming system (t

[Haskell-cafe] Re: Problem with reloading modules in GHC API

2010-07-19 Thread Andy Stewart
Hi Hongmin, I think you're looking for how to hot-swap Haskell program. There are two approach to reach target: 1) Source-Code level: Recompile source code to build new execute cache file, if re-compile successful, use executeFile to switch new entry. You perhaps need use Binary instanc