[Haskell-cafe] Animated line art

Christopher Lane Hinson lane at downstairspeople.org
Fri Dec 5 22:00:35 EST 2008

You may also want to at least look at RSAGL, in particular I've 
implemented an arrow transformer that does much of what you describe with 
threading, although I see that I probably need to go back and work on 

The basic idea revolves around giving threads an identity type that 
implements Eq.  The parent thread can cull threads it doesn't want, while 
the threads themselves can spawn new threads or self-terminate.  If a 
thread spawns a thread ID that already exists, the new duplicate is 
disregarded (unless you choose to provide a different behaviour). 
Anonymous threads are implemented using Maybe.

Threads have an explicit ultimate input and output type, and can 
explicitly switch themselves over to another thread with matching input 
and output types.

Both the spawn and switch directives take a continuous input, which is a 
list or Maybe respectively containing information about what spawn or 
switch should be dispatched at that moment.

Since it's an arrow transformer, you can for example pass 
messages between threads by layering it on top of a StateArrow.

I have also used a StateArrow to accumulate rendering instructions and to 
manage a transformation matrix context.

You talk about adding and removing "things", but I don't think that's a 
good idea.  Rather the thing's existence and disposition is a continuous 
function within a thread.

If it assists with understanding, the StatefulArrow is a stripped down 
arrow transformer version of the YAMPA arrow, and the other arrows build 
on that functionality until you get to the FRP arrow.

The git repo is browsable here:


Relevant modules are ThreadedArrow, SwitchedArrow, StatefulArrow, FRPBase 
and FRP.

I don't have any 2D support in RSAGL at all.

Hopefully this helps and I'd also appreciate any feedback.


More information about the Haskell-Cafe mailing list