[Haskell-cafe] Tutorial on Haskell

Mark T.B. Carroll mark at ixod.org
Mon Apr 16 11:58:02 EDT 2007


Bryan O'Sullivan <bos at serpentine.com> writes:

> Mark T.B. Carroll wrote:
>
>> I'm afraid no
>> examples come easily to mind, though.
>
> Here's a simple one: reading a flattened graph from disk.  If your 
> flattened representation contains forward references, you have to fix 
> them up in a strict language.  In a lazy language, you can refer to 
> elements you haven't yet read, eliminating that book-keeping.

That's a good point. Indeed, I had used laziness in a programme that
read a file that contained a series of entity definitions that could
include forward references, I just couldn't remember exactly how I'd
used laziness. (-: (It's also useful in some memoising, I think.)

-- Mark



More information about the Haskell-Cafe mailing list