how can I run ghci monad actions from ghci command line

Peter Hercek phercek at
Mon Jan 26 13:13:06 EST 2009

Simon Marlow wrote:
> Peter Hercek wrote:
>> Is it possible to run ghci monad actions from ghci command line somehow?
>> For example: I would like to check whether "it" variable is of type 
>> Bool and whether it is True using normal Haskell code (i.e. not using 
>> ghci commands starting with colon like :type :print).
> There's no way to do that right now, although you can play tricks with 
> :define to pipe the output of GHCi commands into Haskell code.  Look 
> up Claus Reinke's example macros - they're on one of the wikis 
> somewhere, but I don't seem to be able to find them with Google right now.
Yes, I know about Claus' tutorial, it was great and I already use his 
techniques a lot. I even did a small change to ghc source code to try 
out some stuff for easier debugging. I'm hoping to post about my 
experience here (maybe in a week or two).

What I was searching for in this post was a possibility to write full 
fledged plugins or something like that.
Never mind, I already went through the initial pain of my custom change 
to ghc so if I ever need something more complicated again I can do my 
tests directly in the source code.


More information about the Glasgow-haskell-users mailing list