
You probably want -ddump-simpl to print Core Yes, the bindings should be in dependency order. They certainly seem to be for me Simon Foo.hs data Numeral = Zero | Succ Numeral zero = Zero one = Succ zero ten = Succ one ghc -c -ddump-stg -ddump-simpl Foo.hs ==================== Tidy Core ==================== Foo.zero :: Foo.Numeral [GlobalId] [NoCafRefs] Foo.zero = Foo.Zero Foo.one :: Foo.Numeral [GlobalId] [NoCafRefs] Foo.one = Foo.Succ Foo.Zero Foo.ten :: Foo.Numeral [GlobalId] [NoCafRefs] Foo.ten = Foo.Succ Foo.one ==================== Tidy Core Rules ==================== ==================== STG syntax: ==================== Foo.zero = NO_CCS Foo.Zero! []; SRT(Foo.zero): [] Foo.one = NO_CCS Foo.Succ! [Foo.Zero]; SRT(Foo.one): [] Foo.ten = NO_CCS Foo.Succ! [Foo.one]; SRT(Foo.ten): [] Foo.Zero = NO_CCS Foo.Zero! []; SRT(Foo.Zero): [] Foo.Succ = \r [eta_s68] Foo.Succ [eta_s68]; SRT(Foo.Succ): [] bash-3.1$ | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of | Victor Nazarov | Sent: 19 November 2007 15:09 | To: glasgow-haskell-users@haskell.org | Subject: The order if bindings generated by GHC | | 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/ | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users