Moreover, functional programming makes it easy to have much more state than imperative programming, namely state over *continuous* time. The temporally discrete time imposed by the imperative model is pretty puny in comparison. Continuous (or "resolution-independent") time has the same advantages as continuous space: resource-adaptive, scalable, transformable.Yes, that's true, but isn't that also the problem with FRP? I mean, most of the papers I'm reading about (A)FRP indicate that no matter how nice it is to have the continuous time model, to get fine grained control over execution times and resources, one needs to fall back to the discrete delta-time approach? And you still need to think about where you have to introduce delays to avoid infinite loops? I might be wrong, since I don't understand everything in these papers yet ;-)
Moreover, functional programming makes it easy to have much more state than imperative programming, namely state over *continuous* time. The temporally discrete time imposed by the imperative model is pretty puny in comparison. Continuous (or "resolution-independent") time has the same advantages as continuous space: resource-adaptive, scalable, transformable.
On Nov 20, 2007 4:11 PM, Lennart Augustsson <lennart@augustsson.net> wrote:
I implemented Tetris in LML long before Haskell existed.
It was text based, but looked good with a custom font. :)
Haskell has no problem with state, it's just explicit.
-- Lennart
On Nov 19, 2007 9:25 PM, Andrew Coppin <andrewcoppin@btinternet.com> wrote:
If you were going to implement Tetris in Haskell, how would you do it?
(For that matter, has anybody already *done* it? It would probably make
a nice example program...)
I'm particularly interested to know
1. How exactly would you do the graphical components? (Presumably
there's some deep trickery with Gtk2hs that can draw free-form stuff
like this.)
2. How do you implement a program that is fundamentally about state
mutation in a programming language which abhors state mutation?
_______________________________________________
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
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe