Ticket #14 (new defect)

Opened 6 years ago

Last modified 6 years ago

Event -> Behaviour -> Event blocking

Reported by: lilac Owned by:
Priority: major Milestone:
Version: Keywords:

Description (last modified by conal) (diff)


reactive-snapshot-patches.bundle (4.8 kB) - added by lilac 6 years ago.
Possible fix
reactive-snapshot-patches.patch (4.8 kB) - added by EyalLotem 6 years ago.
Renamed to .patch so trac color-highlights it

Change History

Changed 6 years ago by lilac

I can no longer reproduce the 'working' behaviour. That is, both of them now fail for me. I plead temporary insanity...

Changed 6 years ago by lilac

The bug is that the 'snap' function, when given an event which never occurs, tries to force the value of the event at time == MaxBound?. Fix:

(Event (Future (Max MaxBound, _))) `snap` _ = mempty

This doesn't fix the problem from which I extracted this example, however. I'll produce another testcase.

Changed 6 years ago by conal

See notes and a sort-of solution in #13

Changed 6 years ago by lilac

Possible fix

Changed 6 years ago by EyalLotem

Renamed to .patch so trac color-highlights it

Changed 6 years ago by conal

  • description modified (diff)

Richard: I love your idea of using unamb to make the AddBounds Ord instance lazier. Thanks!

Changed 6 years ago by conal


There's something lovely to tease out in your skipToR definition. (t' max t'', r'') looks like join on Future, because, on times, max == mappend, and join on pairs mappend-s the auxiliary values.

Jules Bean (quicksilver) defined Event join using Future join instead of my clumsy adjustE (which also uses time max). I tweaked & prettied his definition until it came out to the following:

joinE :: Ord t => EventG t (EventG t a) -> EventG t a
joinE = inEvent (>>= g)
   g (e `Stepper` ee) = eFuture (e `mappend` joinE ee)

Note that the (>>=) here is on Future.

Sadly this lovely definition doesn't fix the join laziness problem.

Given that my snapshotWith used Event join, which is definable via Future join, and yours uses Future join in disguise, my hunch is that we're converging to the same definition.

I wonder now if your improved Ord on AddBounds will fix the laziness bug with Event join. I'll try some experiments.

Please keep on thinking deeply about Reactive. I love your insights!

Changed 6 years ago by conal

I tried Richard's lazier Ord for AddBounds (using unamb for short-circuiting with min MinBound and max MaxBound). It led to strange delays in a reactive-fieldtrip program. My mouse click isn't responded to until I move the mouse. I don't know what to make of this behavior.

Note: See TracTickets for help on using tickets.