Simpler Fibonacci function

Eray Ozkural (exa)
Sat, 9 Feb 2002 06:00:53 +0200

Hash: SHA1

On Tuesday 05 February 2002 21:08, Paul Hudak wrote:
> Well, I cannot speak for the other references, since I did not write
> them :-).  On the other hand, stream processing *is* a stylistic way to
> write certain kinds of functional programs, with the idea of replacing
> an iteration with a stream.  But I agree that this particular example
> should not be the equivalent of "hello world".  (Of course, for that,
> one would just write:

A stream is still an iteration. I think fibonacci (series) function is best 
represented as a recursive function, and if you want to show that functional 
languages look a bit like mathematics then that is how it should have been 
demonstrated. All that juggling in the original version Brian complained 
about may have arisen from efficiency considerations (was it the case?), 
however such considerations do not have any pedagogic use. [*]
And as I had pointed out before, that tutorial is not at all the brightest 
piece of introductory documentation when you compare it to certain printed 
texts for Haskell programming language. (In any case, the ocaml tutorial 
seems to me better designed than haskell's 'gentle' introduction.) Brian 
would probably be much more comfortable with a decent book....


[*] If I had to teach someone the horrible C language, I would not start with 
"goto" statement that might make a performance difference in certain codes. 
(And "goto" is used in C codes when it will be efficient)

- -- 
Eray Ozkural (exa) <>
Comp. Sci. Dept., Bilkent University, Ankara
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see