The order if bindings generated by GHC

Victor Nazarov asviraspossible at gmail.com
Mon Nov 19 10:08:52 EST 2007


I use STG-bindings generated by GHC during CoreToSTG phase. What is
the order of this bindings is it random or does it correspond to
original source code or does it reflect the dependency structure of
the program?
If I define the following in my program:

data Numeral = Zero | Succ Numeral

zero = Zero
one = Succ zero
...
ten = Succ nine

the order of zero .. ten definition will remain the same, but the
special Zero binding will be generated and added to the end of the
bindings list. But Zero is used by binding of one (strangely enough)
so order doesn't reflect dependency. What is the order of bindings? If
I need the order reflecting dependency, should I sort it myself by SRT
tables or there is an easier way?

-- 
vir
http://vir.comtv.ru/


More information about the Glasgow-haskell-users mailing list