The advantage is that disabling and enabling the trace takes only one line comment.

You must keep in mind that due to lazy evaluation your traces will only print if the value they wrap is ever demanded.

The trace function is located in the base package. The package htrace defines a trace function similar to the one in the base package, but with indentation for better visual effect (see the mailing list thread for examples). Other tools can be found at the debug category in Hackage.

A more powerful alternative for this approach is Hood. Even if it hasn't been
updated in some time, Hood works perfectly with the current ghc
distribution. Even more, Hugs has it already integrated, see the manual page. Add an import Observe and start inserting observations in your code.
For instance:

2 The Safe Library

There is a safe library of functions from the Prelude that can crash, see the safe library. If you get an error message such as "pattern match failure, head []", you can then use headNote "extra information" to get a more detailed error message for that particular call to head. The safe library also has functions that return default values and wrap their computation in Maybe as required.

3 Offline analysis of traces

The most advanced debugging tools are based in offline analysis of traces. Hat is probably the most up-to-date tool for this, offering a comprehensive set of tools. Neil Mitchell has made available a Windows port of Hat at his site.

The disadvantage of these tools is that they are not always compatible with the latest libraries, so you can put them to use only in some cases.

Some Hat user should complete this section

4 Dynamic breakpoints in GHCi

Finally, the GHCi debugger project aims to bring dynamic
breakpoints and intermediate values observation to GHCi in a near
future. Right now the tool is only available from the site as a
modified version of GHC, so unfortunately you will have to compile it
yourself if you want to have it.

This tool allows to set breakpoints in your code, directly from the GHCi command prompt. An example session:

Once a breakpoint is hit, you can explore the bindings in scope, as well as to evaluate any haskell expression, as you would do in a normal GHCi prompt. The ':print' command can be very useful to explore the lazyness of your code.