úÎfàbdC      !"#$%&'()*+,-./0123456789:;<=>?@AB experimentalconal@conal.net as a function Constant-optimized functions  experimentalconal@conal.net0Access a future value. Blocks until available. CBlock forever Make a  5 and a way to fill it. The filler should be invoked  only once. Make a  ", given a way to compute a value. DRace to extract a value. Run an E-action-valued  . Value available in the future.    experimentalconal@conal.net- <Reactive value from an initial value and a new-value event. !Apply a unary function inside an 89 representation. !Apply a unary function inside an 89 representation. F Merge two   streams into one.  Switch between reactive values. DMake an event and a sink for feeding the event. Each value sent to . the sink becomes an occurrence of the event. Tracing variant of  Show specialization of  Run an event in a new thread. 2Subscribe a listener to an event. Wrapper around  and G. $Run an event in the current thread. ERun a reactive value in a new thread. The initial action happens in  the current thread. 9Accumulating event, starting from an initial value and a  update-function event. Like H for events AAccumulate values from a monoid-valued event. Specialization of  , using I  and J  EPair each event value with the previous one, given an initial value. BCount occurrences of an event, remembering the occurrence values.  See also  FCount occurrences of an event, forgetting the occurrence values. See  also . ,Difference of successive event occurrences. 4Snapshot a reactive value whenever an event occurs. Like " but discarding event data (often a is ()). ?Filter an event according to whether a boolean source is true. 'Just the first occurrence of an event. !Tracing of events. "AMake an extensible event. The returned sink is a way to add new  events to mix. $:Reactive value from an initial value and an updater event %Like H for reactive values &AAccumulate values from a monoid-valued event. Specialization of  , using I  and J  'Start out blank (K ), latching onto each new a, and blanking  on each b5. If you just want to latch and not blank, then use  J  for lose. ('Flip-flopping source. Turns true when ea occurs and false when  eb occurs. )Count occurrences of an event *Tracing of reactive values +*Replace a functor value with a given one. ,%Forget a functor value, replace with () - Pass through Just occurrences. .Pass through values satisfying p. / Value sink 0+Convenient alias for dropping parentheses. 1'Reactive behaviors. Simply a reactive ction value. Wrapped in  a type composition to get L and M  for free. 2Time for continuous behaviors 3?Compatibility synonym (for ease of transition from DataDriven) 4EReactive value: a discretely changing value. Reactive values can be H understood in terms of (a) a simple denotational semantics of reactive F values as functions of time, and (b) the corresponding instances for 4 functions. The semantics is given by the function (%$) :: Reactive a  -> (Time -> a)4. A reactive value also has a current value and an " event (stream of future values). Instances for 4  N : a typical lifted monoid. If o is a monoid, then   Reactive o is a monoid, with mempty = pure mempty, and  mappend =  liftA2 mappend. In other words, mempty %$ t == mempty, and (r  I  s) %$ t == (r %$ t) I  (s %$ t).  L: fmap f r %$ t == f (r %$ t).  M : pure a %$ t == a, and (s <*> r) %$ t ==  (s %$ t) (r %$ t).  O: return a %$ t == a, and join rr %$ t == (rr %$ t)  %$ t. As always, (r >>= f) == join (fmap f r). 6initial value 7waiting for event 84Event, i.e., a stream of future values. Instances:  N : J % is the event that never occurs, and e I   e'- is the event that combines occurrences from e and e'. (Fran's  neverE and (.|.).)  L: fmap f e# is the event that occurs whenever e occurs, 0 and whose occurrence values come from applying f to the values from  e. (Fran's (==>).)  M : pure a' is an event with a single occurrence, ( available from the beginning of time. ef <*> ex is an event whose  occurrences are made from the product of the occurrences of ef and  ex. For every occurrence f at time tf of ef and occurrence x  at time tx of ex, ef <*> ex has an occurrence f x at time max  tf tx.  O: return a is the same as pure a (as always). In e >>=  f, each occurrence of e leads, through f, to a new event.  Similarly for join ee+, which is somehow simpler for me to think  about. The occurrences of e >>= f (or join ee) correspond to the D union of the occurrences of all such events. For example, suppose  we'Bre playing Asteroids and tracking collisions. Each collision can F break an asteroid into more of them, each of which has to be tracked ; for more collisions. Another example: A chat room has an enter 2 event, whose occurrences contain new events like speak. 0  !"#$%&'()*+,-./0123456789:089:45673  !"#$%&'()*21+,0/-. experimentalconal@conal.net;9Force a future. The real version blocks until knowable. <=Wrap a type into one having new least and greatest elements, # preserving the existing ordering. =Ordered monoid under P. ?Ordered monoid under Q. AA future value of type a with time type t. Semantically, just a  time/:value pair, but those values would not be available until  ;d, which could block. B0Time of some event occurrence, which can be any Ord type. In an E actual implementation, we would not usually have access to the time E value until (slightly after) that time. Extracting the actual time B would block until the time is known. The added bounds represent G -Infinity and +Infinity. Pure values have time minBound (-Infinity), D while eternally unknowable values (non-occurring events) have time  maxBound (+Infinity). ;<RST=U>?V@AWB;<=>?@ABX    !"#$%&'()*+,-./0123456789:;<=>?@ABBCDEFGH<IJKLMN O P QR S TUVWXYZEG[ reactive-0.2Data.Fun Data.Future Data.Reactive Data.SFuturebase GHC.IOBaseGHC.BaseGHC.List Data.Monoid Data.MaybeControl.ApplicativeapplyFunKforce newFuturefuture runFutureFutureNeverstepperinEventinEvent2switchermkEvent mkEventTrace mkEventShowforkE subscriberunEforkRaccumEscanlEmonoidE withPrevEcountEcountE_diffEsnapshot snapshot_whenEoncetraceEeventX mkReactiveaccumRscanlRmonoidRmaybeRflipFlopcountRtraceRreplaceforget joinMaybesfilterMPSinkAction ReactiveBTimeSourceReactiveStepperrInitrEventEventeFuture AddBoundsMingetMinMaxgetMaxhangraceIOmergefmapscanlmappendmemptyNothingFunctor ApplicativeMonoidMonadminmaxMaxBoundNoBoundMinBound