Hi Facundo
Currently there is no way to disable the simple optimiser, but it would be easy to add a flag to do so.
I'm not sure if that is really what you want -- you'll be left with a program with a lot of "junk" like (let x = y in ...). But maybe LH doesn't mind the junk!
If you decide that is what you want, I'm sure we (or you) can add a flag to control it. The relevant code is in GHC.HsToCore, below
Before you go much further, do open a ticket.
Simon
I think this the code you want to disable with a flag:
; let simpl_opts = initSimpleOpts dflags
; let (ds_binds, ds_rules_for_imps, occ_anald_binds)
= simpleOptPgm simpl_opts mod final_pgm rules_for_imps
-- The simpleOptPgm gets rid of type
-- bindings plus any stupid dead code
; putDumpFileMaybe logger Opt_D_dump_occur_anal "Occurrence analysis"
FormatCore (pprCoreBindings occ_anald_binds $$ pprRules ds_rules_for_imps )
; endPassHscEnvIO hsc_env name_ppr_ctx CoreDesugarOpt ds_binds ds_rules_for_imps