download diagram (.svg), fonts (cmr10.ttf, cmtt10.ttf)
For me as a Haskell beginner the biggest problem in understanding Yampa reactimate was how the objects are actually passed around and transformed as all the signatures are very, very… very generic. This diagram shows an example scenario staring Pacman (the player), a cherry (enemy trigger) and a ghost (the enemy).
- Starting at the upper left corner.
- Collect input events in
init(which are empty here) and pass them throughprocess,coreall the way down torouteandkillAndSpawn. coreis called with an initial empty object state (which is fed-back in recursively!*) and an initial list of object signal functions. It is very important to separate the logic of the objects (signal functions) and the output they produce (state).routegets the empty state and no input events, effectively keeping the object collection the same. Note thatkillAndSpawndoesn’t switch in this step. The object states are passed tooutputwhere they are rendered.- In the next step (t=1), still having the same core (core=A), the user produces an input event which is routed to all objects and makes the Pacman move to the cherry.
routeonly checks for collision events in the previous state, thus no collision events are recognized in this step. - In t=2, still having the same core (core=A),
routedetects a collision between Pacman and the cherry and produces collision events, which are only routed to the objects in charge. This causeskillAndSpawnto kill the cherry, spawn the ghost and therefore generate a switching event, which results in the creation of a newcoreinprocess.
*) I didn’t really know how to illustrate the recursion of core.


Nice diagram, you know I wonder why there is no visual programming language based of off arrows that would generate Haskell code.
Actually http://imve.informatik.uni-hamburg.de/files/71-Blom-Diss-online.pdf mentions are program they developed. Have a look here: http://imve.informatik.uni-hamburg.de/projects/VisualAFRP
@Gerold Meisinger thanks for the link, is there a place to download the tool? I’m going to put this link up on reddit.com/r/haskell/ where i’ve been linking your blog a couple of times
http://www.csse.uwa.edu.au/~joel/vfpe/
> where i’ve been linking your blog a couple of times
which gave me a boost of 250 visits
thank you!
The link looks like a different tool from the one on the VisualAFRP page unfortunately.
hmm, the Blom paper mentions “Kelso, VFPE, Visual Functional Programming Environment”. i don’t know if there is a more recent version of VFPE available (haven’t used it yet).
Blom is active on the Yampa mailing list, like here: http://mailman.cs.yale.edu/pipermail/yampa-users/2010-June/000336.html . maybe you want to ask him.
I just corrected some errors in the diagram
The actual program is called VPE and is described in the german master thesis” Visuelle Entwicklungsumgebung zur Erzeugung von Haskell AFRP Code” by Piotr Szal. I didn’t find any public version unfortunately.