[Haskell] Re: Newbie : How come that cyclic recursive lists are efficient ?

Ferenc Wagner wferi at afavant.elte.hu
Thu Feb 10 07:31:27 EST 2005

Francis Girard <francis.girard at free.fr> writes:

> But I can't help thinking that the distinction between "being" a list of 
> integers and "being" a function that "returns" a list of integers (without 
> arguments) is not always clear in FP ... since there is not really such a 
> thing as returning a value in declarative programming, neither in 
> mathematical thinking.

Please correct me if I'm wrong, but I can recall that this
distinction is made by hamming::[Integer] having no
arguments, so it gets memoized within its scope.  Being a
CAF (top level constant applicative form) only means it
can't go out of scope so has no chance of recomputation at
all.  Am I right?

More information about the Haskell mailing list