[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: [Haskell-cafe] How to use FRP for Simulation
From: martin <martin.drautzburg () web ! de>
Date: 2018-01-20 14:12:20
Message-ID: 5A634E44.1070109 () web ! de
[Download RAW message or body]
Hello all,
the answer to the question "what is FRP good for?" often includes "simulation".
I somewhat understand the "reactive" situation, where an FRP system receives Events \
from the outside world and computes Events to be sent to the outside world. To do so, \
the computation uses Behaviors which are essentially time-varying states.
I also read, that the programmer should not be allowed to literally define Events and \
Behaviors, or she might end up writing bad prograns which exhibit time or space \
leaks. She should only be allowed to define transformations.
Now in a discrete event simulation (DES) there is a lot of "event stuff" going on and \
FRP looks like a good paradigm. However, in a simulation nothing comes from the \
outside world and not much goes to the outside world. There is a simulation result, \
but it is just a result like any other and doesn't have much to do with Time. A DES \
is not really a reactive system at all.
In DES there is typically a set of initial Events and more events are created as the \
simulation progresses. I cannot see how this can be done without the power to \
explicitly create Events. Also these Events point to the "future" and must therefore \
carry an explicit (simulated) Time, whereas (IIRC) in FRP, Events do not necessarily \
carry an explicit Time. They just occur, and if you need the time, you look at the \
clock (a Behavior Time).
So what exactly is meant by "FRP is useful for simulation". Does it mean that a DES \
engine can be written in FRP style or does it mean something else?
If one can indeed write a DES engine in FPR style, what is the correct way of \
thinking about it? _______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic