You need to look into functional reactive programming, but be warned, this is active research :-) Two libraries I know of in which you can currently make working simulations are Yampa and Elerea. But the former doesn't scale really well, and the latter might not really be functional (I think it's not referentially transparent)
Other libraries such as Reactive and Grapefruit are very promising, but I don't know their current status. Good luck. For me (I'm also an experienced imperative programmer in the simulation field), Haskell is very addictive, but also insanely frustrating because I never have the feeling I know the language well enough and I don't see the big picture yet. So I can't yet achieve in Haskell what I can in other languages, but purity and laziness are drugs, so you're doomed :-) On Tue, Aug 18, 2009 at 2:42 PM, Eric Wong <wsy...@gmail.com> wrote: > Hello, Haskellers! > > 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 data-flow kind of applications, I can > easily > structure the problem in a functional way and sketch out an intuitive > picture > of the computation. 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 global shared state, is it right? > > Then what's the best way to simulate private states or just instead how to > solve simulation problems such as a physical engine using the haskell way? > > Best regards. > Eric > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe >
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe