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 : > > 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,

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

2009-03-13 Thread Cristiano Paris
2009/3/13 Marcin Kosiba : > 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 (x, k) > >    

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

2009-03-13 Thread David Menendez
2009/3/13 Marcin Kosiba : > > 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 -> >     do_stuff_three >

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 : > > ... > > 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_

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

2009-03-13 Thread Cristiano Paris
2009/3/13 Marcin Kosiba : > ... > 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 -> >     do_stuff_thre

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

2009-03-13 Thread minh thu
2009/3/13 Marcin Kosiba : > On Friday 13 March 2009, you wrote: >> 2009/3/13 Marcin Kosiba : >> > On Thursday 12 March 2009, you wrote: >> >> 2009/3/12 Marcin Kosiba : >> >> > Hi, >> >> >I'm doing a bit of research into mobility models and I'm >> >> > currently exploring implementation lang

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 : > > On Thursday 12 March 2009, you wrote: > >> 2009/3/12 Marcin Kosiba : > >> > Hi, > >> >        I'm doing a bit of research into mobility models and I'm > >> > currently exploring implementation language choices for the simulator > >

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

2009-03-12 Thread minh thu
2009/3/13 Marcin Kosiba : > On Thursday 12 March 2009, you wrote: >> 2009/3/12 Marcin Kosiba : >> > 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 require

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 : > > 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 node's mob

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

2009-03-12 Thread minh thu
2009/3/12 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 > thoug

[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 imple