[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-14 Thread Chung-chieh Shan
zaxis wrote in article <27844016.p...@talk.nabble.com> in gmane.comp.lang.haskell.cafe: > As we know, the local variable is allocated on stack which is thread > safe. It's not. http://en.wikipedia.org/wiki/Funarg_problem#Example -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread Stefan Monnier
> 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. It is true that a pure language could support such things (some pure languages do, e.g. Sisal). The experience of

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread John Lato
> From: zaxis > > 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. > In addition to John Millikin's suggestion, you can also do: map f [0..99] where f :: Int ->