Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell.

Name: Anonymous 2011-01-30 13:46

This obscure language represents a peculiar corner of the programming language world called functional languages. One of the peculiar things about such languages is that they don’t have variables. Although Haskell isn’t widely known among programmers, those who know of functional languages suspect that they, too, are rather slow

Name: Anonymous 2011-01-30 19:01

>>1
Obvious troll.  Haskell has two different kinds of variables, type variables and value variables.  For example, the definition of id shows both:

id :: forall a. a -> a
id x = x


Here, "a" is a type variable.  Every time you call "id", and most times you even use "id" as a value, that type variable takes the value necessary to make the program type check.  This incurs no runtime penalty -- the types are stripped from the program during compilation, like most languages with static type systems.

Then "x" is a value variable.  Each time you call "id", "x" has a different value.  That is, it varies.  Hence, variable.

Some people have the misconception that Haskell has no variables.  This is like saying that "Why is it that northwestern American English speakers don't have an accent?"  Of course they have accents, because an accent is, by definition, "the way they pronounce words".  Because they do pronounce words, they have an accent.  And because a variable is by definition "something that varies", Haskell must indeed have variables.

You just can't change the value which a variable holds, unless you're using an IORef or similar.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List