Comment by prof_hobart
14 years ago
One obvious reason would be if the input to your expression is relatively large or complex (e.g. a file).
14 years ago
One obvious reason would be if the input to your expression is relatively large or complex (e.g. a file).
That would not be obvious to me. I often have to process quite large and messy XML files and a functional approach works well. I'm not even sure how inserting print statements would be helpful.
There may be far better ways of doing it, but for a Haskell beginner (and I'm certainly one of those), being able to quickly display what each function was seeing as its input/returning as its result as it chugged through a complex file would have made life a lot easier for me when I first tried this kind of parsing in Haskell.