Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-19 Thread Peter Verswyvelen
I don't really agree that in Haskell when it comes to simulation a program just is. That is the idealized story. At least when writing your own simulation engine, in practice you have to deal with operational details such as future unknown values that can block computations; to much laziness can

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Ertugrul Soeylemez
Eric Wong wsy...@gmail.com wrote: I'm relatively new to haskell and due to my strong imperative background, it's really a pain to learn haskell. But I'm really indulged in it. :) Now I think I understand the basics of Haskell very well, such as the type system and monad. And for those

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Ertugrul Soeylemez
Ertugrul Soeylemez e...@ertes.de wrote: computation :: State [Object] Result computation = do objs0 - get (result, objs1) - doSomethingWith objs0 put objs1 return result Misindented, sorry. Again: computation :: State [Object] Result computation = do

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Maurí­cio CA
...) But for simulation kind-of problems, in which I think OO really fits the best, what's the haskell way to structure such problems? I once thought maybe I can use the State monad to simulate objects. But it's really hard for me to implement, because I think State monad is used to simulate a

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Marcin Kosiba
On Tuesday 18 August 2009, Maurí­cio CA wrote: ...) But for simulation kind-of problems, in which I think OO really fits the best, what's the haskell way to structure such problems? I once thought maybe I can use the State monad to simulate objects. But it's really hard for me to

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Eric Wong
I used to think about a physical engine in a similar way, and I think it can work. But in some simulations that objects have lots of dependencies on others can be tricky. For instance, object o1 depends on o2, if we represent them in pure values, when we update o2, then o1 must be updated with a

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Peter Verswyvelen
You could read: http://www.cs.nott.ac.uk/~nhn/FoPAD2007/Talks/nhn-FoPAD2007.pdf http://haskell.cs.yale.edu/yale/papers/haskell-workshop03/yampa-arcade.pdf http://www.cs.nott.ac.uk/~nhn/Talks/HW2002-FRPContinued.pdf http://www.haskell.org/yale/papers/haskellworkshop02/index.html

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Ertugrul Soeylemez
Eric Wong wsy...@gmail.com wrote: I used to think about a physical engine in a similar way, and I think it can work. But in some simulations that objects have lots of dependencies on others can be tricky. For instance, object o1 depends on o2, if we represent them in pure values, when we

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Peter Verswyvelen
It is interesting to note that recent work on AFRP (arrow-based FRP) - namely Causal Commutative Arrows - optimizes a complete circuit of arrows (interconnected objects if you prefer to think that way) that all have local state and local feedback loops into one large state and feedback loop,

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Eric Wong
Thanks for all your post. When I was using C and Python, I used to think of most applications in an simulation way. I think it's right to say that programs are simulations. But now I have to change my mind in Haskell, I have to think in a data-flow way, that is: data in, processing using

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Jason Dusek
2009/08/18 Eric Wong wsy...@gmail.com: When I was using C and Python, I used to think of most applications in an simulation way. By simulation way, do you mean object-oriented way? -- Jason Dusek ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Jason Dagit
On Tue, Aug 18, 2009 at 5:19 PM, Eric Wongwsy...@gmail.com wrote: Thanks for all your post. When I was using C and Python, I used to think of most applications in an simulation way.  I think it's right to say that programs are simulations. On a philosophical note, this is a sign of expertise.

[Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Maurí­cio CA
When I was using C and Python, I used to think of most applications in an simulation way. I think it's right to say that programs are simulations. But now I have to change my mind in Haskell, I have to think in a data-flow way, that is: data in, processing using function composition, data out.

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Shiyou Wang
By simulation way, do you mean object-oriented way? they are similar, but not equal, I think. OO is great for simulation, but simulation does not necessarily use OO. Virtual machine simulates real machines, you can use OO language to do it, but most use C in the real world I think. So,

Re: [Haskell-cafe] Re: simulation in the haskell way

2009-08-18 Thread Eric Wong
Sorry for a mistake. Shiyou Wang is my identity in a private chinese group. Sorry for the confusing. :-( Eric ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe