λ Tony's Blog λ
What is Haskell's primary feature?Posted on January 22, 2010
Today I was asked what Haskell’s main feature is. The answer is its non-strict evaluation.
Java is a strictly evaluated language. Consider this Java program:
The program fails with a runtime error.
Consider this (otherwise equivalent) Haskell program:
The program prints 3 and does not fail like the Java program. This is a key property of Haskell with very far reaching implications. One of those implications is that Haskell is a pure language. There are many more implications, particularly with respect to the compositional properties of programs.
Haskell’s evaluation model and its implications is perhaps its most widely misunderstood feature. While the benefits are (enormously) enormous, they are far too deep to consider writing a short article about.