[reactive] Is Reactive.integral broken?

Conal Elliott conal at conal.net
Tue Jan 13 19:03:49 EST 2009


Hi Eyal,

Yes, integral is probably broken.  It uses snapshot, which uses event join,
which relies on my new unreleased changes in the structure of Time, which
relies on unamb working well, which needs recent fixes to GHC's run-time
system.

Thanks to community input (notably from Sterling, Bertram, and Simon M), the
RTS problems were identified and solved.  I'm waiting for a stable ghc
snapshot with RTS fixes that will then unblock unamb and the new Reactive
stuff.

Regards,  - Conal

2009/1/13 Eyal Lotem <eyal.lotem at gmail.com>

> The problematic expression is:
>
> let ticks = R.atTimes [0,0.1..] :: R.Event ()
>     integration = ticks `R.integral` R.time
> in integration
>
> The value inside integration is always 0.
>
> But here is a full sample program to demonstrate the problem:
>
> {-# OPTIONS -fglasgow-exts -O2 -Wall #-}
>
> import Control.Applicative
> import qualified FRP.Reactive as R
> import qualified Graphics.FieldTrip as FT
> import Graphics.FieldTrip((*%))
> import qualified FRP.Reactive.FieldTrip.Adapter as FieldTripA
>
> resize :: (FT.Transform (FT.Transform3 s) a) => s -> a -> a
> resize size = (FT.uscale3 size *%)
>
> utext :: String -> FT.Geometry3
> utext = FT.flatG . FT.utext
>
> main :: IO ()
> main = do
>   let ticks = R.atTimes [0,0.1..] :: R.Event ()
>       integration = ticks `R.integral` R.time
>   FieldTripA.anim3 . pure $ resize (0.3::Double) . utext . show <$>
> integration
>
>
> _______________________________________________
> 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/20090113/a836e6d3/attachment-0001.htm


More information about the Reactive mailing list