Vivian McPhail wrote:
Hi,
I've implemented a Neural Net simulator which needs to repeat a training loop many times. For this I used a while function:
while test body = do
(cond,res) <- body
if (test cond) then do rs <- while test body
TECTED]
ise.net.nz> cc:
Sent by: Subject: [Haskell] Mona
and there is a maximum ?stack size.
Is there a better way to implement (possibly infinite) loops in Haskell?
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
> http://haskell.org/hawiki/TailRecursive
>
>>
>> could you produce a (lazy) list of results instead?
>> the garbage collector might be able to collect
>> the list cells that are no longer needed
>>
>> possibly, a lazy state monad would help
>> (if
Hello,
Vivian uses this while function:
while test body = do
(cond,res) <- body
if (test cond) then do rs <- while test body
return (res:rs)
else return [res]
> However, when I run the program, the interp
d help
> (if the computation of "while test body" cannot fail)
>
> > Is there a better way to implement (possibly infinite) loops in Haskell?
You could have a look at "Tackling the awkward squad: monadic input/output,
concurrency, exceptions, and foreign-language calls in Hask
e list cells that are no longer needed
possibly, a lazy state monad would help
(if the computation of "while test body" cannot fail)
Is there a better way to implement (possibly infinite) loops in Haskell?
generally, don't program your own recursions -
use pre-defined combinators
actually
force it to. In case your condition (cond) doesn't force the evaluation of all
transformations you get large unevaluated stuff in you memory.
Is there a better way to implement (possibly infinite) loops in Haskell?
I' am curious as well!
Cheers,
Georg
--
Georg Martius, Te
and there is a maximum ?stack size.
Is there a better way to implement (possibly infinite) loops in Haskell?
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
On Wed, Jun 11, 2003 at 09:39:24AM -0700, Hal Daume III wrote:
> 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
> d
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
'tr
I have a stupid question :)
Is there something like "while" loop in GHC ??
Thanks very much :)
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
I have a stupid question :)
Is there something like "while" loop in GHC ??
Thanks very much :)
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
13 matches
Mail list logo