This recipe shows how to do print-debugging using the Debug
module's spy
and traceM
functions. The compiler will emit warnings to remind you to remove these debug functions before you ship production code.
Does console-printing-based debugging in various contexts to show the pros/cons of each approach and how reliable/unpredictable they can be.
For the browser, make sure to open the console with dev tools first, then reload/refresh the page.