Вы находитесь на странице: 1из 1

What is Haskell?

Haskell is a static, pure, lazy, functional language. Gee, that sounds an awful
lot like buzzword lingo!
That may well be, but these properties make Haskell a very effective language, a
nd sometimes a bit
odd. These properties are also opposite to most mainstream languages. For instan
ce, Java is static,
impure, eager, and not functional, Ruby is dynamic, impure, eager, and only func
tional at times. While
it is hard to give an accurate definition of every characteristic, we will try a
nyway.
Functional: Haskell puts an emphasis on functions and treats computation as the
evaluation of
functions. This in contrast to so-called imperative languages, that specify an o
rder of instructions. As
such, Haskell functions very often resemble mathematical functions closely. Bein
g functional also has
practical implications. For instance, iteration is accomplished by means of recu
rsion, and functions
are also values and can be passed to other functions.
Pure: Haskell is a pure language, in that functions do not have side-effects. Th
is means that existing
values cannot be changed, since changing data would be a side-effect of a functi
on. It also guarantees
that the evaluation of a function will always result in the same value given the
same function
arguments.
Lazy: As a lazy language, Haskell only evaluates expressions when needed. Say yo
u just implemented
a function that gives a list of all prime numbers. In a strict language, the fun
ction that makes the list
will never terminate (since there are always more prime numbers). Haskell, on th
e contrary, will only

Вам также может понравиться