
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. Cheers, Creighton import FRP.Reactive import FRP.Reactive.LegacyAdapters import Control.Concurrent import Control.Monad 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

Hi Creighton,
Looks like you're getting close to at least one bug. Thanks very much.
Would you do me a favor and make a trac ticket, to make sure it doesn't slip
through the cracks of my memory? The trac URL is
http://trac.haskell.org/reactive .
If you or anyone has a suggestion or bug report to offer and doesn't want to
make a trac ticket, please let me know, and I'll do it. Better yet, let me
know if there's anything I can do to make it more convenient to use trac.
Regards, - Conal
2008/11/12 Creighton Hogg
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.
Cheers, Creighton
import FRP.Reactive import FRP.Reactive.LegacyAdapters import Control.Concurrent import Control.Monad
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 _______________________________________________ Reactive mailing list Reactive@haskell.org http://www.haskell.org/mailman/listinfo/reactive
participants (2)
-
Conal Elliott
-
Creighton Hogg