[Haskell-cafe] Recursion problem in infinite list model

Hans Aberg haberg at math.su.se
Fri Mar 28 09:23:28 EDT 2008


I have fixed the problem now. In the last letter, with the Natural  
class, I had not added
   instance Num Natural where
     (N x) - (N y) = N(x - y)
which the Ordinal class then in fact has one. Then it turns out that  
it is merely the fact that "show" had some cases looking at the list  
length that blocked its output. So there, one should probably have  
some recursion that extracts elements one by one, without computing  
list length, and adds a termination 2]" if the remaining list is empty.

So it seems possible to emulate Haskell list behavior with this  
model, which is one thing I wanted to know.

   Hans




More information about the Haskell-Cafe mailing list