LOOPS

Hal Daume III hdaume@ISI.EDU
Wed, 11 Jun 2003 09:39:24 -0700 (PDT)


It depends how much you mean "like" :).  Usually whatever you would solve
using a while loop in an imperative language is solved with recursion in
Haskell.

The problem with directly having 'while' is that such a statement
depends necessarily on mutable variables (otherwise, if the condition is
'true' at the start, it will never be 'false').  Moreover, there isn't
usually a return value associated with a while statement.

--
 Hal Daume III                                   | hdaume@isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume

On Wed, 11 Jun 2003, Filip wrote:

> I have a stupid question :)
> Is there something like "while" loop in GHC ??
> 
> Thanks very much :)
> _______________________________________________
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>