[Haskell] Monadic Loops

2004-06-17 Thread Vivian McPhail
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 retur

[Haskell] Monadic Loops

2004-06-17 Thread Vivian McPhail
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 return

Re: [Haskell] Monadic Loops

2004-06-17 Thread Georg Martius
Hi, On Thu, 17 Jun 2004 21:19:17 +1200, Vivian McPhail <[EMAIL PROTECTED]> wrote: Hi, I've implemented a Neural Net simulator which needs to repeat a training loop many times. It seams we are doing the same thing. I will share my one quite soon. For this I used a while function: while test body = d

Re: [Haskell] Monadic Loops

2004-06-17 Thread Johannes Waldmann
while test body = do (cond,res) <- body if (test cond) then do rs <- while test body return (res:rs) else return [res] do you need the monad here? what monad is it? the problem could to be that the "return

Re: [Haskell] Monadic Loops

2004-06-17 Thread Peter Robinson
On Thursday 17 June 2004 12:39, Johannes Waldmann wrote: > > while test body = do > > (cond,res) <- body > > if (test cond) then do rs <- while test body > > return (res:rs) > > else return [res] > > do you

Re: [Haskell] Monadic Loops

2004-06-17 Thread Arjan van IJzendoorn
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

Re: [Haskell] Monadic Loops

2004-06-17 Thread Gustavo Villavicencio
An interesting paper on Monads and Recursion is "Merging Monads and Folds for Functional Programming" Erik Meijer and Johan Jeuring best regards, gustavo Peter Robinson said: > On Thursday 17 June 2004 12:39, Johannes Waldmann wrote: >> > while test body = do >> > (cond,res) <-

Re: [Haskell] Monadic Loops

2004-06-17 Thread Ben . Yu
TECTED] ise.net.nz> cc: Sent by: Subject: [Haskell] Mona

Re: [Haskell] Monadic Loops

2004-06-18 Thread John Hughes
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