
It should be possible to change (1) the environment returned by System.getEnv (2) the arguments returned by System.getArgs (3) System.getProgName in GHCi (for example, using :set).
By the way, my partial solution to grumble (1) is
:def modules (\ modulesStr -> do { let { imports = Prelude.map (\ modName -> ("import "++(if modName == "+" then "Prelude" else modName)++"\n")) (Prelude.words modulesStr) ; imod = "module XYZZY where \n"++(Prelude.concat imports) } ; Prelude.writeFile "/tmp/XYZZY.hs" imod ; Prelude.return ":load /tmp/XYZZY.hs" } )
Yes, I experimented with something similar for a while, but did it in an incremental way - I had a :import command which added a line to a temporary module and then re-loaded it. I agree we should have a better way to control scoping at the prompt; there have been one or two good suggestions in the past, but we just haven't got around to implementing anything yet. Cheers, Simon
participants (1)
-
Simon Marlow