On 26 April 2011 00:53, Ryan Ingram
<ryani.spam@gmail.com> wrote:
I've been working on Haskell for quite a while and it's not too often that a beginner shows me a new trick--this trick with trace seems really cool and I hadn't seen it before.
f x | trace ("f " ++ show x) False = undefined
f ... -- rest of regular definition
Makes it really easy to add the trace and then later comment it out. One problem I always have with traces the usual way is that adding/removing them is kind of annoying--it can change the indentation of your code, etc. So this trick is really useful!