When GHC compiles PrelNum (or any other module) it often invents new
local functions and gives them arbitrary names. These show up in
the interface file, PrelNum.hi, as you'll see if you look in it.
A module that imports PrelNum may inline somethign PrelNum exports
and therefore it may now mention these arbitrarily-named things.
If you compile PrelNum with -ddump-simpl you'll see a printout
of the complete module just before code generation; it'll mention
everything. But beware that the act of doing -ddump-simpl may change
the numbering, so you may then need to recompile the rest of the Prelude.
If you don't want these things to happen, recompile the prelude without -O.
Simon
| -----Original Message-----
| From: Kwanghoon Choi [mailto:[EMAIL PROTECTED]]
| Sent: 20 March 2000 12:10
| To: [EMAIL PROTECTED]
| Subject: STG syntax
|
|
|
| Hello,
|
| During reading some program in STG, I met some definition that I was
| not able to find its definition. Its name is PrelNum.zdwtpl3,
| or $wtpl3
| according to GHC's internal name convention, Z-encoding.
| Though I understnad
| the prefix $w means it is a worker function, I don't know how
| I can get
| its definition.
|
| ...
| case PrelNum.zdwtpl3{-reD,j-}
| ^^^^^^^^^^^^^^^
| ww2{-c2hh-}
| ww{-c2hi-} :: (# PrelGHC.Intzh{-3e,s-} #)
| of wild4{-c2jf-} {
| -- lvs: [ww2{-c2hh-} ww{-c2hi-} x{-c2hM-}\ ]; rhs
| lvs: [x{-c2hM-}];
| PrelGHC.ZLzhzx20zhZR{-81,s-} ww3{-c2hN-} ->
| ...
|
| I hope to have a modest sample program in a STG-like FL with
| which I am
| playing. To do so, I make a Haskell program what I want, extract
| its STG version by running GHC -O2, and then translate the version
| appropriately (by hand, yet). During the works, I met the
| above problem.
|
| In addition to the identifiers PrelNum.zdwtpl[nnn], I am not able
| to find the definition of something like PrelList.lvl[nnn], neither.
|
| Regards.
|
| Kwanghoon Choi
|
|
|