[reactive] Curious crash
wchogg at gmail.com
Wed Nov 12 15:54:09 EST 2008
So below is something I discovered that seems very strange.
If you run the following code as is, it will run & you'll get stuck in the
already documented integral loop.
If you replace the use of events in main with events', the program consumes
all available memory & locks up hard.
I know I'm horribly abusing Reactive here, but I don't see why it should
fail _so_ ungracefully.
x :: Event () -> Behavior Double
x e = b where b = integral e b
events :: Event ()
events = atTimes [0.1,0.2]
events' :: Event ()
events' = once events
schedule a = threadDelay 100000 >> a
main = do
c <- makeClock
u <- mkUpdater (cGetTime c) (fmap print $ x events)
forever $ schedule u
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Reactive