[Haskell-cafe] If the local variable can be changed ...
zaxis
z_axis at 163.com
Tue Mar 9 19:25:13 EST 2010
In FP the variable can not be changed once created. Yes, it has much
advantage . However, i feel it is too strict. As we know, the local
variable is allocated on stack which is thread safe.
So if the local variable can be changed, then we can use loop, etc. same as
imperative languages. For example, for (i=0; i<100; i++) where `i` is a
local variable in function.
Any suggestion is appreciated!
-----
fac n = let { f = foldr (*) 1 [1..n] } in f
--
View this message in context: http://old.nabble.com/If-the-local-variable-can-be-changed-...-tp27844016p27844016.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe
mailing list