Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-14 Thread Marcin Kosiba
On Friday 13 March 2009, Cristiano Paris wrote: 2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I've already checked those out. I tried using your yield implementation and while it works, I couldn't get it to work with the state monad.        So while: data RecPair a b =

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread minh thu
2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: On Thursday 12 March 2009, you wrote: 2009/3/12 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I'm doing a bit of research into mobility models and I'm currently exploring implementation language choices for the simulator (*snip*) The

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread Marcin Kosiba
On Friday 13 March 2009, you wrote: 2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: On Thursday 12 March 2009, you wrote: 2009/3/12 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I'm doing a bit of research into mobility models and I'm currently exploring implementation language

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread minh thu
2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: On Friday 13 March 2009, you wrote: 2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: On Thursday 12 March 2009, you wrote: 2009/3/12 Marcin Kosiba marcin.kos...@gmail.com: Hi, I'm doing a bit of research into mobility models and

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread Cristiano Paris
2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: ... Threading the state is not the problem. Maybe this will help: what I have now: fsm world state = case state of  first -    do_stuff_one    (move_up, succ state)  second -    do_stuff_two    (move_left, succ state)  third -    

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread Marcin Kosiba
On Friday 13 March 2009, Cristiano Paris wrote: 2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: ... Threading the state is not the problem. Maybe this will help: what I have now: fsm world state = case state of  first -    do_stuff_one    (move_up, succ state)  second -    

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread David Menendez
2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: Threading the state is not the problem. Maybe this will help: what I have now: fsm world state = case state of  first -    do_stuff_one    (move_up, succ state)  second -    do_stuff_two    (move_left, succ state)  third -    

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-13 Thread Cristiano Paris
2009/3/13 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I've already checked those out. I tried using your yield implementation and while it works, I couldn't get it to work with the state monad.        So while: data RecPair a b = Nil | RP (b, a - RecPair a b) yield x = Cont $ \k - RP

[Haskell-cafe] Using a monad to decompose a function into functions

2009-03-12 Thread Marcin Kosiba
Hi, I'm doing a bit of research into mobility models and I'm currently exploring implementation language choices for the simulator (yes, sadly it needs to be a custom one). I've been using Haskell here and there for some small tasks, and thought I should consider it as an

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-12 Thread minh thu
2009/3/12 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I'm doing a bit of research into mobility models and I'm currently exploring implementation language choices for the simulator (yes, sadly it needs to be a custom one).        I've been using Haskell here and there for some small

Re: [Haskell-cafe] Using a monad to decompose a function into functions

2009-03-12 Thread Marcin Kosiba
On Thursday 12 March 2009, you wrote: 2009/3/12 Marcin Kosiba marcin.kos...@gmail.com: Hi,        I'm doing a bit of research into mobility models and I'm currently exploring implementation language choices for the simulator (*snip*) The simulation algorithm requires expressing the