Where do we need Lazy data structures ? Can anyone suggest me few good
   examples proving the need of Lazy data structures or provide me a
   pointer to look for them.

By "lazy data structures" do you mean datatypes with non-strict
constructors?  If so, the literature is full of arguments along the
lines of "separating data from control", "allowing infinite data
structures", etc.  But, there is no "proof" that we need them.
Indeed, there is no "proof" that we need data structures at all (:-).

   Besides I/O where do we need irrefutable pattern matching. Sometime
   back there was some discussion about irrefutable patterns by Paul
   Hudak. But, I fear it didn't give egs. where such pattern matching was
   needed

My earlier message tried to argue for the merits of "lazy patterns", a
technical term for a kind of pattern matching in Haskell, which is a
somewhat separate issue from having lazy data structures to begin with.
On the other hand, if I remember right, I included several examples
that should motivate lazy data structures, too.  In particular, there
was an example of a "simulation program" that would be much more
cumbersome without lazy data structures.

There was also a recent message announcing the availability of a
Haskell tutorial that Joe Fasel and I recently wrote.  It contains
lots of examples motivating pretty much every feature of Haskell (at
least, that was our intent!).  Another good reference would be Bird
and Wadler's textbook "Introduction to Functional Programming"
(Prentice Hall, 1988).

Cheers,

  -Paul


Reply via email to