[Haskell-cafe] Re: Haskell vs OCaml
Erik de Castro Lopo
hc-erikd at mega-nerd.com
Wed May 4 03:17:01 EDT 2005
On Wed, 4 May 2005 03:02:58 -0400
ajb at spamcop.net wrote:
> Quoting Erik de Castro Lopo <hc-erikd at mega-nerd.com>:
>
> > Yes, but only if your functions are impure.
>
> Wrong. An unevaluated thunk can, in general, be much larger than what
> the thunk evaluates to. (Think of "length" of a large list, for example.)
> If such a thunk is unevaluated but not garbage for a considerable time,
> then you have a space leak.
>
> So you do need to think about evaluation order. One good rule of thumb
> is: On large data structures, try to have a single consumer only.
Ahh, OK. Thats a significantly non-trivial detail to have to
think about :-).
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo nospam at mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
"It's far too easy to make fun of Microsoft products, but it takes a
real man to make them work, and a god to make them do anything useful"
-- Anonymous
More information about the Haskell-Cafe
mailing list