Version 5 of Haskell

Updated 2002-11-26 00:04:49

A "polymorphicly typed, lazy, purely functional language".

See http://www.haskell.org


What do those words above really mean though?

Functional languages are those languages whose basic computational construct is the function. They tend to be either completely side-effect free or to partition those parts of the language that have side effects off very carefully. They are very common among people developing advanced logic systems, and have some popularity in other fields as well.

Lazy means that the language only evaluates expressions when it needs to. What this means is that if you write a function that returns the first of its two arguments (discarding the second) and then call that function with the expressions "1+2" and "1/0" as first and second arguments respectively, you won't get an error but instead the value "3".". - RS: In Tcl we have this in if and expr:

 expr {$i==0? $i+2: 1./$i}
 if {$i==0} {expr {$i+2}} else {expr {1./$i}}

-NEM: But Haskell's laziness allows you to deal with infinite lists as well:

 take 10 [1..]
 --> [1,2,3,4,5,6,7,8,9,10]

The values are computed as they are needed.

Polymorphic typing is a scheme for defining the types of things like lists, trees and other constructed types that allows for a very high degree of type safety even with extremely complex use. The full theory is a bit long to go into here, but it is based on type variables. Anyone interested should read things like The Definition and Semantics of Standard ML for more details.


Interfacing Tcl with Haskell - Playing Haskell - Tcl and other languages