[Haskell-cafe] Recursion problem in infinite list model

Hans Aberg haberg at math.su.se
Thu Mar 27 10:41:13 EDT 2008


On 27 Mar 2008, at 15:18, Claude Heiland-Allen wrote:

> The combination of (-+) and h is too strict, this modification works:
>
> (-+) :: a -> List a -> List a
> x -+ ~(List y) = List(f) where   -- lazy pattern match
>   f 0 = x
>   f k = y(k-1)

Thank you for the fast response. Yes, that might be what I want. I  
had a look at lazy patterns, but could not figure out how to put them  
in. So thanks again.

   Hans Aberg




More information about the Haskell-Cafe mailing list