
Nathan Hüsken
I have a simple SDL based graphic demo, which I am trying (for educational purposes) to rewrite utilizing netwire.
The demo basically consists of a State which contains a list of object states.
[...]
But I avoided rewriting "updateState" in wire format. But I have no Idea how to do that. How do I handle a dynamic list of objects in a wire?
Well, you are not really using FRP here. You are just forcing this application into the FRP model. Your only behavior is the application itself. This works, but buys you nothing. The first step to actually making use of FRP here is to get rid of the concept of "updating" something. Express your game objects themselves as wires: player :: GameWire (Input, [Wall]) Player wall :: GameWire a Wall enemy :: GameWire (Player, [Wall]) Enemy This allows you to write static game worlds. After that you can move to dynamic game worlds using wire transformers from Control.Wire.Trans.Combine. It is also pretty straightforward to write your own wire transformers for this purpose. You probably want to do that later -- just look at the source code. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/