Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-23 Thread Ketil Malde
Brian Hulley [EMAIL PROTECTED] writes: But how does this change the fact that y still has 1 more element than yq? yq is after all, not a circular list. infinity+1 = infinity Surely this is just a mathematical convention, not reality! :-) Not even that. Infinity isn't a number, and it

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-23 Thread Ross Paterson
On Thu, Jun 22, 2006 at 05:44:58PM +0100, I wrote: It works because Haskell 'data' definitions yield both an initial fixed point (with respect to strict functions) and a terminal fixed point (with respect to arbitrary functions), and moreover these are usually the same. The former is

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Brian Hulley
Jerzy Karczmarczuk wrote: Brian Hulley wrote: [EMAIL PROTECTED] wrote: you may transform a recurrential equation yielding Y out of X: Y[n+1] = a*X[n+1] + b*Y[n] usually (imperatively) implemented as a loop, into a stream definition: ... Can you explain how this transformation was

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread minh thu
2006/6/22, Brian Hulley [EMAIL PROTECTED]: Jerzy Karczmarczuk wrote: Brian Hulley wrote: [snip] y IS NOT a longer list than yq, since co-recursive equations without limiting cases, apply only to *infinite* streams. Obviously, the consumer of such a stream will generate a finite segment

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Brian Hulley
minh thu wrote: 2006/6/22, Brian Hulley [EMAIL PROTECTED]: Jerzy Karczmarczuk wrote: Brian Hulley wrote: [snip] y IS NOT a longer list than yq, since co-recursive equations without limiting cases, apply only to *infinite* streams. Obviously, the consumer of such a stream will generate a

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Jon Fairbairn
On 2006-06-22 at 15:16BST Brian Hulley wrote: minh thu wrote: y and yq are infinite... But how does this change the fact that y still has 1 more element than yq? yq is after all, not a circular list. infinity+1 = infinity I don't see why induction can't just be applied infinitely to

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Bill Wood
On Thu, 2006-06-22 at 15:16 +0100, Brian Hulley wrote: . . . But how does this change the fact that y still has 1 more element than yq? yq is after all, not a circular list. I don't see why induction can't just be applied infinitely to prove this. The set of all non-negative integers has

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread minh thu
2006/6/22, Brian Hulley [EMAIL PROTECTED]: minh thu wrote: 2006/6/22, Brian Hulley [EMAIL PROTECTED]: Jerzy Karczmarczuk wrote: Brian Hulley wrote: [snip] y IS NOT a longer list than yq, since co-recursive equations without limiting cases, apply only to *infinite* streams. Obviously, the

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Brian Hulley
Jon Fairbairn wrote: On 2006-06-22 at 15:16BST Brian Hulley wrote: minh thu wrote: y and yq are infinite... But how does this change the fact that y still has 1 more element than yq? yq is after all, not a circular list. infinity+1 = infinity Surely this is just a mathematical

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Jon Fairbairn
On 2006-06-22 at 15:45BST Brian Hulley wrote: Jon Fairbairn wrote: infinity+1 = infinity Surely this is just a mathematical convention, not reality! :-) I'm not sure how to answer that. The only equality worth talking about on numbers (and lists) is the mathematical one, and it's a

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Robert Dockins
On Jun 22, 2006, at 10:16 AM, Brian Hulley wrote: minh thu wrote: 2006/6/22, Brian Hulley [EMAIL PROTECTED]: Jerzy Karczmarczuk wrote: Brian Hulley wrote: [snip] y IS NOT a longer list than yq, since co-recursive equations without limiting cases, apply only to *infinite* streams.

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Ross Paterson
On Thu, Jun 22, 2006 at 11:06:38AM -0400, Robert Dockins wrote: aside Every few months a discussion arises about induction and Haskell datatypes, and I feel compelled to trot out this oft-misunderstood fact about Haskell: 'data' declarations in Haskell introduce co- inductive

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Brian Hulley
minh thu wrote: maybe i wrong, anyway : induction can be used to prove a property. we claim that the property is true for any finite i. so what's the property that you want to prove by induction ? you say 'by induction on the lenght of yq'.. but yq is just y (modulo the a*xq + b*). it's exactly