[Haskell-cafe] Splitting Hairs Over Terminology

P. R. Stanley prstanley at ntlworld.com
Mon Feb 26 22:17:21 EST 2007

>>I'm assuming that the ":" function takes two arguments and returns
>>a newly constructed list which is assigned to the variable holding/ 
>>pointing to the old list.
>First part correct, second quite wrong --- Haskell doesn't have
>destructive assignment in the general case.  There are special cases,
>such as IORefs and MVars and TVars, but Haskell puts restrictions on
>how you go about using such impure operations.

You know, as soon as I posted the message I remembered the 
destructive  assignment thingummy. the following is what I was talking about:
Prelude> 13:[1, 2]
[13, 1, 2]
which I don't believe has an address in the memory, correct?

Back to the comma, surely, syntax sugar fulfills the role of an 
operator, a function, or a sequence of low-level procedures, either 
in part or comprehensively.
In C, for example, iteration could be implemented using the if 
construct with the dreaded goto command. So, strictly speaking, the 
while loop could be classed as syntax sugar. Yet, the while loop is a 
well-recognized construct in its own right.
I hope you can see what I'm driving at.

More information about the Haskell-Cafe mailing list