News for hackers. Stuff that matters.
Re:Why Lisp is a Big Hack and Haskell is Doomed to Succeed (... by judk on Sunday March 30, 2014 @05:22PM (#7498002)
Coincidentally, I just saw a reddit comment where someone showed a way to statically add a debug statement to every function definition. The trick is to use a "pattern guard" to evaluate the trace, and then compare the result to "undefined" (never matches), so that the program continues on to look for a pattern that matches.
Re:Why Lisp is a Big Hack and Haskell is Doomed to Succeed (... by axman6 on Sunday March 30, 2014 @09:12PM (#7498902)
do you mean the:

    foo x | trace (show x) False = undefined
          | otherwise = ... x ...
? That's not comparing anything to undefined, now is it a pattern guard, it's executing the trace function which then returns False leading to the next guard being evaluated and the actual computation being performed. The undefined is just there because it always type checks, and will never execute.