'''[http://www.haskell.org%|%Haskell]''' is a [polymorphism%|%polymorphicly]-typed, lazy, purely [functional programming%|%functional] language ** See Also ** [Interfacing Tcl with Haskell]: [Playing Haskell]: [Tcl and other languages]: [FranTk]: is a declarative [GUI] binding of [Tk] ** Description ** '''[functional programming%|%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}} ====== [VK]: 2006-11-19: bad example of laziness. I can't imagine how these lines will ever divide by 0. Only if a language will precalculate all its possible branches... but this is not realistic. These lines, even writen in [C] (very non-lazy language) will not divide by 0. [NEM]: Yes, but only because 'if' and the conditional operator in [C] are also lazy (well, non-strict). Pretty much all languages have some mix of strict and non-strict operations. The difference with Haskell is that it is lazy by default, which allows the definition of if to be rather neat: ====== if True t e = t if False t e = e ====== [NEM]: 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. '''[polymorphism%|%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. ---- In Haskell it is not possible to assign a value to a variable. Therefore a program runs completely side-effect free. <> Functional Programming | Language