how can I run ghci monad actions from ghci command line

Peter Hercek phercek at
Mon Jan 26 15:01:48 EST 2009

Claus Reinke wrote:
> If the necessary functionality is not yet exposed through
> the API, it probably should be (iirc, GHCi's frontend itself
> isn't part of the API, but the functionality used by it is, so GHCi
> is just one of several GHC API clients; don't know how far the 
> debugger features you are interested in are tied to the frontend
> or available for all GHC API sessions). As usual, there is the design 
> question of what to expose and how, on which GHC HQ would like user 
> input. Nothing is as helpful for that as an actual use case!-) So, 
> yes, please do report on your experiments.
Actually, I do not think I want much. I just want to have something 
significantly better than printf debugging for my application. GHC/GHCi 
hacking is not my primary goal. Even now I think I'm better off with 
ghci and my extensions than with printf debugging. It will improve much 
when 6.10.2 is out (fixing ticket #2740 you helped to pin down). This 
mostly means adding some ghci commands which automate what I'm doing 
manually when debugging. Most of my expriments are related to the 
tickets I filled in: checking whether I can have some cheap workarourd 
till they are implemented or whether they actually help as much as I hope.

That means that for anything more complicated I need access directly to 
the representation of the same code which is just being debugged. From 
your response it looks that if I needed something more again I'll just 
need to create my own version of GHCi driver and reuse the rest through 
GHC API. If there is some tutorial how to build custom GHCi driver or 
something else at a higher level (i.e. not the GHC API docs directly), 
please, let me know.

I'll post when I have my first round of enhancements done and will be 
able at least guess how much they are helping. It may even help GHC team 
to decide whether to scrap my tickets or implement them :-D


More information about the Glasgow-haskell-users mailing list