
7 Jun
2009
7 Jun
'09
6:01 p.m.
Hello ptrash, Sunday, June 7, 2009, 9:41:56 PM, you wrote:
Hi, how can I change the value of a variable.
there are no variables in haskell :))) x, like any other identifier, is a value. when you translate to Haskell some algo that needs to update variable contents, you may either 1) use recursion: length (x:xs) = 1 + length xs length [] = 0 2) use references (IORef). like in C, references by itself are non-mutable, but they point to values that can be mutated -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com