Hi Tony,
I don't see these stack traces when the data is small. It only happens when the proof system I'm writing tries to generate very, very large proofs. This is almost always due to a bug where it isn't cutting correctly. However, with the stack being blown, I don't see where the real fault is. The structures should always be finite.
I rewrote the findLast operation using foldLeft, but I see in another stack trace that looks almost the same that it passes through findLast.
What I don't understand is why mappend would fail like this. I'd have thought that it could be implemented by taking (lhs, rhs), and producing a StreamT that pops the next element off lhs untll that's done, and then returns rhs. This shouldn't introduce any stack-frames. The naive way to implement it would be to recurse through lhs and then prepend the elements to rhs I guess.
Matthew