
27 Mar
2009
27 Mar
'09
9:03 p.m.
On Thu, 26 Mar 2009, wren ng thornton wrote:
Thomas Hartman wrote:
Luke, does your explanation to Guenther have anything to do with coinduction? -- the property that a producer gives a little bit of output at each step of recursion, which a consumer can than crunch in a lazy way?
It has more to do with "tying the knot" (using laziness to define values in terms of themselves), though there are similarities. Take the function:
infZipWith f ~(x:xs) ~(y:ys) = f x y : infZipWith f xs ys
What about using a custom list type, that has only one constructor like (:), that is, a type for infinite lists?