> 2. how would I have found/fixed such an error in a more complex function
> w/o assertions and w/o print statements?
Good questions
There was a proposal to put assertions into Std Haskell, which we
have implemented in GHC. (I'm not sure we've yet put that version out
though.) So assertions are definitely coming. You are right that they
are important.
Finding infinite loops in functional programs is quite hard. Colin
Runciman and Jan Sparud have been working on "redex trails". We
plan to help at least identify where the loop is by putting out
cost-centre-stack information... but that's still in the works.
Simon