In Haskell, you can use Debug.Trace for just that purpose, when you don't want to change the type of your function.