|
|
|
|
|
by nahiluhmot
4775 days ago
|
|
It wasn't so much a bad example so much as it was a trivial one. Perhaps a more powerful one (that displays the advantages of lazy evaluation and higher-order functions) would be the function to generate an infinite list of Fibonacci numbers. fibs :: [Integer]
fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
Even still, it's difficult to get the feel of actually using the language from one function taken from a freshman year CS class. |
|