[Extended the debugger documentation with a 'tips' section Pepe Iborra **20070107191227] { hunk ./docs/users_guide/ghci.xml 1644 +A short debugging session hunk ./docs/users_guide/ghci.xml 1662 - + hunk ./docs/users_guide/ghci.xml 1771 - + Tips + + * Use PRAGMAs to fine tune which modules are loaded under debugging mode + + {-# OPTIONS_GHC -fdebugging #-} + + + * Repeated use of seq and + :print may be necessary to observe unevaluated + untyped bindings + see + + + * GHC.Exts.unsafeCoerce can help if you are positive about the type of a binding + +type MyLongType a = [Maybe [Maybe a]] + +main:Main> :m +GHC.Exts +main:Main> main +Local bindings in scope: + x :: a +Main.hs:15> let x' = unsafeCoerce x :: MyLongType Bool +Main.hs:15> x' +[Just [Just False, Just True]] + + Note that a wrong coercion will likely result in your debugging session being interrupted by a segmentation fault + + + * The undocumented (and unsupported) :force command + + equivalent to :print with automatic + seq forcing, + may prove useful to replace sequences of seq and + :print in some situations. + + + + }