[Haskell-cafe] some way to reverse engineer lambda expressions out of the debugger?

Donald Bruce Stewart dons at cse.unsw.edu.au
Mon Jan 1 02:46:29 EST 2007

> I am a newbie learning haskell. (First forum post.)
> I am wondering if there is a trick to get debugging information about
> functions out of the environment (which for me, for now, is ghci).  
> In this example, 
> *UnixTools> :t map (*) [1,2]
> map (*) [1,2] :: (Num a) => [a -> a]
> This is very nice, but I would *really* like to see something like 
> *UnixTools> explodeLambda( map (*) [1,2] )
> [(\x -> 1*x),(\x -> 2*x)]
> Yes, maybe I'm dreaming, but I would like haskell to reverse engineer /
> pretty print lambda expressions for me.

You can use 'hat' to trace/reduce expressions.


The new ghci debugger can print closures too, but I'm not sure if it
does what you want.

All very possible, maybe a little experimental though.

-- Don

More information about the Haskell-Cafe mailing list