So below is something I discovered that seems very strange.<br><br>If you run the following code as is, it will run & you'll get stuck in the already documented integral loop.<br>If you replace the use of events in main with events', the program consumes all available memory & locks up hard.<br>
<br>I know I'm horribly abusing Reactive here, but I don't see why it should fail _so_ ungracefully.<br><br>Cheers,<br>Creighton<br><br>import FRP.Reactive<br>import FRP.Reactive.LegacyAdapters<br>import Control.Concurrent<br>
import Control.Monad<br><br>x :: Event () -> Behavior Double<br>x e = b where b = integral e b<br><br>events :: Event ()<br>events = atTimes [0.1,0.2]<br><br>events' :: Event ()<br>events' = once events<br><br>
schedule a = threadDelay 100000 >> a<br><br>main = do<br> c <- makeClock<br> u <- mkUpdater (cGetTime c) (fmap print $ x events)<br> forever $ schedule u