úÎp˜k½L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK experimentalconal@conal.netConstant-optimized functions non-constant function constant function  as a function  experimentalconal@conal.net Value available in the future. Future that never arrives. Future that may arrive. The L* blocks until available. No side-effect. 0Access a future value. Blocks until available. MBlock 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. NRace to extract a value. Run an L-action-valued .     experimentalconal@conal.net4  Value sink +Convenient alias for dropping parentheses. 'Reactive behaviors. Simply a reactive ction value. Wrapped in  a type composition to get O and P for free. Time for continuous behaviors ?Compatibility synonym (for ease of transition from DataDriven) EReactive 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   Q: 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  R s) %$ t == (r %$ t) R (s %$ t).  O: fmap f r %$ t == f (r %$ t).  P: pure a %$ t == a, and (s <*> r) %$ t ==  (s %$ t) (r %$ t).  S: return a %$ t == a, and join rr %$ t == (rr %$ t)  %$ t. As always, (r >>= f) == join (fmap f r). initial value waiting for event 4Event, i.e., a stream of future values. Instances:  Q: T% is the event that never occurs, and e R  e'- is the event that combines occurrences from e and e'. (Fran's  neverE and (.|.).)  O: 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 (==>).)  P: 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.  S: 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. An + especially useful monad-based function is 9, which filters a  Maybe-valued event. <Reactive value from an initial value and a new-value event. !Apply a unary function inside an  representation. !Apply a unary function inside an  representation. U Merge two  streams into one. V Switch between reactive values. WDMake 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 X. $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. See also 0. #Like Y for events. See also 1. $AAccumulate values from a monoid-valued event. Specialization of  #, using R and T . See also 2. %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 & . See also 5. (,Difference of successive event occurrences. )4Snapshot a reactive value whenever an event occurs. Z*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. You can often use '(>>=)' or [ instead. Warning: / this function might be removed at some point. /0EReactive value from an initial value and an updater event. See also  ". 1Like Y for reactive values. See also #. 2AAccumulate values from a monoid-valued event. Specialization of  #, using R and T . See also $. 3Start out blank (\), latching onto each new a, and blanking  on each b5. If you just want to latch and not blank, then use  T for lose. 4'Flip-flopping source. Turns true when ea occurs and false when  eb occurs. 5)Count occurrences of an event. See also &. 6Tracing of reactive values 7*Replace a functor value with a given one. 8%Forget a functor value, replace with () 9 Pass through Just occurrences. :Pass through values satisfying p. 0  !"#$%&'()*+,-./0123456789:0 !"#$%&'()*+,-./0123456 78 9:0  !"#$%&'()*+,-./0123456789: experimentalconal@conal.net;=Wrap a type into one having new least and greatest elements, # preserving the existing ordering. <=>?Ordered monoid under ]. @ABOrdered monoid under ^. CDEA future value of type a with time type t. Semantically, just a  time/:value pair, but those values would not be available until  forced, which could block. FGH0Time 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). IA future's time JA future's value K5Make a future container into a container of futures. ;<=>?@ABCDEFGHIJKHEFGIJKBCD?@A;>=<;>=<<=>?@A@ABCDCDEFGFGHIJK_      !"#$%&'()*+,-./0123456789:;<=>?@AABCCDEFGHIJKLMNOPNQRNSTNSUNOVNSWXYZNO[N\]^N_`NabNcdNcefreactive-0.5.0.1Data.Fun Data.Future Data.Reactive Data.SFutureFunKapplyFutureNeverforce newFuturefuture runFutureSinkAction ReactiveBTimeSourceReactiveStepperrInitrEventEventeFuturestepperinEventinEvent2switchermkEvent mkEventTrace mkEventShowforkE subscriberunEforkRaccumEscanlEmonoidE withPrevEcountEcountE_diffEsnapshot snapshot_whenEoncetraceEeventX mkReactiveaccumRscanlRmonoidRmaybeRflipFlopcountRtraceRreplaceforget joinMaybesfilterMP AddBoundsMaxBoundNoBoundMinBoundMingetMinMaxgetMaxunFuturefutTimefutVal sequenceFghc-prim GHC.TypesIOhangracebaseGHC.BaseFunctorControl.Applicative Applicative Data.MonoidMonoidmappendMonadmemptymergejoinEjoinRfmapGHC.Listscanlsnap Control.Monadjoin Data.MaybeNothing GHC.Classesminmax