
I'm trying to map lambda names in Yhc Core code back to the containing functions, but there doesn't seem to be any obvious way of doing this. I was wondering if anyone had any ideas. I've spotted a previous mailing list post (http://www.haskell.org/pipermail/yhc/2007-June/000957.html) and a google code bug (http://code.google.com/p/yhc/issues/detail?id=141) but no evidence of anything having been done. Does anyone have any ideas what naming would be nice? Given: module Test where main = (\a -> a) 42 presumably we want something like Test;main!LAMBDAxxx - with whatever seperator seems nice. Using a different symbol has the same reasoning as using the ";" - to make it easy for Yhc Core based tools, see (http://www.haskell.org/pipermail/yhc/2007-August/001044.html). As far as implementing this goes, it seems that liftLambda in Lift.hs is naming the function, but I can't work out where the code it is lifting came from. Any pointers on that would be appreciated. Thanks

On Sun, 4 Jan 2009 19:32:50 +0000
Andrew Oakley
As far as implementing this goes, it seems that liftLambda in Lift.hs is naming the function, but I can't work out where the code it is lifting came from. Any pointers on that would be appreciated.
Once I send ask the question it becomes obvious :). Seems the name is in ptid. The following patch seems to do whats needed although I'm really not sure about the "getUnqualified" bit, it seems like there must be an easier way to generate the right thing. --- old-compiler/Lift.hs 2009-01-04 20:13:32.000000000 +0000 +++ new-compiler/Lift.hs 2009-01-04 20:13:32.000000000 +0000 @@ -114,7 +114,7 @@ scHere = (fun, PosLambda pos fl [] (newEnvs++args) exp) arity = length newEnvs + length args (fun,state2) = uniqueIS stateIn - tid = (visible (reverse ("LAMBDA" ++ strId fun))) -- Not exported + tid = (visible (reverse (getUnqualified ptid ++ "!LAMBDA" ++ strId fun))) -- Not exported newSC = scHere:scIn newState = seq tid $ addIS fun (InfoName fun tid arity (tidPos ptid pos) True) --PHtprof Comments/suggestions please :)
participants (1)
-
Andrew Oakley