[Haskell-cafe] Perfect example
dpiponi at gmail.com
Fri Aug 3 10:46:03 EDT 2007
On 8/2/07, Jon Harrop <jon at ffconsultancy.com> wrote:
> Any suggestions for a perfect example that uniquely demonstrates the benefits
> of the Haskell language compared to other languages?
For short and sweet, power series is a nice example. Try
http://www.cs.dartmouth.edu/~doug/powser.html. Makes nice use of
laziness to allow power series to consume earlier members of the
series to produce later ones. Power series 'reversion' has
traditionally been a tricky thing to code up but it's almost trivial
in Haskell. And power series for many transcendental functions can be
implemented directly from defining differential equations.
More information about the Haskell-Cafe