[Haskell-cafe] Call for GUI examples - Functional Reactive Programming

Heinrich Apfelmus apfelmus at quantentunnel.de
Sun Jul 10 17:17:47 CEST 2011


Henning Thielemann wrote:
> Heinrich Apfelmus wrote:
> 
>> Question: how would you actually like to describe the guitar simulator 
>> at a high-level? Did you already wish for some specific combinators? 
>> Assume that you had something like reactive-banana available and 
>> imagine that there were a benevolent djinn granting you three new 
>> primitive combinators of your choice.
> 
> If I would know of appropriate combinators, I would just implement them 
> and not ask the djinn. :-)

Fair enough. :D

How did you do it with lazy lists? The more I think about it, the more I 
come to the conclusion that it's impossible to implement this without 
duplicating the event data type. As said, the main problem is that you 
want a combinator

    append :: Pattern -> Pattern -> Pattern

that plays the second pattern (event sequence, the guitar strum) right 
after the first one. This means that patterns are *finite*, but this 
seems to collide with the requirement that any FRP style  Event  must be 
potentially infinite.

Once you do implement a small DSL for patterns, everything is fine, 
though, as the Wave.hs example demonstrates.


Best regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com




More information about the Haskell-Cafe mailing list