[reactive] Is Reactive.integral broken?
Eyal Lotem
eyal.lotem at gmail.com
Tue Jan 13 18:16:54 EST 2009
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20090114/fca9524f/attachment.htm
More information about the Reactive
mailing list