[reactive] More recursive fun
Conal Elliott
conal at conal.net
Tue Nov 18 00:53:34 EST 2008
Creighton,
Yes, I would expect this example to run fine, not lock up.
Thanks again for diving into this non-termination problem.
- Conal
2008/11/17 Creighton Hogg <wchogg at gmail.com>
> So in the interest of simplifying the recursive integral problem as much as
> possible, to make it a bit more tractable, I've come up with another
> recursive Behavior definition that I think should work if the current
> implementation of integral is expected to work. I'd just like to get an
> opinion on that to see if it's a test case I should try digging harder
> into. As I said, I _think_ that this should work iff the current definition
> of integral should work but if that's not true, please let me know. My
> reasoning is that this should be the equivalent of using integral with an
> event stream that has a constant difference of 1.
>
> Thanks,
> Creighton
>
> myIntegral :: Event a -> Behavior Double -> Behavior Double
> myIntegral e b = let e' = snapshot_ e b in sumB e'
>
> x :: Event () -> Behavior Double
> x e = let b =myIntegral' e b in b
>
> events :: Event ()
> events = atTimes [0.1,0.2]
>
> schedule a = threadDelay 100000 >> a
>
> main = do
> c <- makeClock
> u <- mkUpdater (cGetTime c) (fmap print $ x events)
> forever $ schedule u
>
> _______________________________________________
> Reactive mailing list
> Reactive at haskell.org
> http://www.haskell.org/mailman/listinfo/reactive
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20081117/73379870/attachment.htm
More information about the Reactive
mailing list