Using MonadPlus in FRP.Reactive.FieldTrip

Posted by ony on Stack Overflow See other posts from Stack Overflow or by ony
Published on 2010-04-03T17:25:25Z Indexed on 2010/04/26 9:13 UTC
Read the original article Hit count: 260

I'm studying FRP at this moment through FieldTrip adaptor. And hit the problem with strange way of frames scheduling and integration. So now I'm trying to build own marker Event for aligning Behaviour stepping.

So...

flipflop :: Behavior String
flipflop = stepper "none" (xflip 2) where
    xflip t0 = do
        t <- withTimeE_ (atTime t0)
        return "flip" `mplus` xflop (t+3)
    xflop t0 = do
        t <- withTimeE_ (atTime t0)
        return "flop" `mplus` xflip (t+2)
txtGeom = ((uscale2 (0.5::Float) *%) . utext . show <$>)
main = anim2 (txtGeom . pure flipflop)

Questions is:

  • Why this example leads to memory leak?
  • Is there safe way to build sequence of events where each next one is scheduled depending on previous?
  • © Stack Overflow or respective owner

    Related posts about haskell

    Related posts about functional-programming