ghci debugger: showing function argumetns when stopped at its definition

Peter Hercek phercek at
Wed Jul 15 03:09:59 EDT 2009

On Mon, 13 Jul 2009 20:48:42 -0400, Isaac Dupree wrote:
> Peter Hercek wrote:
>> Simon Marlow wrote:
>>> On 10/07/2009 15:31, Peter Hercek wrote:
>>>> It would be cool if ghci debugger could grab not only the free
>>>> variables in the selected expression but in one case a bit more. The
>>>> case is when we stop at a function definition the first time (when
>>>> just entering it).
>>> The problem is that functions can be defined with multiple equations,
>>> each giving different names for the arguments. e.g. in
>>> f x 0 = x
>>> f 0 x = x
>>> when we stop at f, what do you want to see?
>> Right, I did not realize this problem. But your idea of using _arx<N>
>> naming in case of more equations seems best to me. I would still like
>> to have it available.
> Even in one equation, pattern match can make it undesirable. Say, in
> fromJust (Just x) = ...
> doesn't allow you access to the argument directly.  Can _argN be
> provided in *all* cases (possibly in addition to other bindings)?

I was thinking about adding _argN always too. If it is done in addition 
to other binding (which are not ambiguous) then even better. Regardless 
I'm fine with any solution which allows me to access arguments more 
easily (i.e. without tracing on (to manually search for call site) or 
without trying to mark all first usages).


More information about the Glasgow-haskell-users mailing list