śĪūČņŌ–       ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”• experimentalconal@conal.netBSerializer. Turns actions into equivalent but serialized actions Make a locking serializer ,Make a locking serializer with a given lock  experimentalconal@conal.net7Returns the value in the IVar. The *value* will block $ until the variable becomes filled. 8Returns Nothing if the IVar has no value yet, otherwise  returns the value. 8Puts the value of the IVar. If it already has a value,  block forever.  experimentalconal@conal.net experimentalconal@conal.netOrdered monoid under –.    experimentalconal@conal.net Ordered monoid under —.    experimentalconal@conal.net=Wrap a type into one having new least and greatest elements, # preserving the existing ordering.  experimentalconal@conal.netConstant-optimized functions  experimentalconal@conal.netValue consumer +Convenient alias for dropping parentheses.  experimentalconal@conal.netA future value of type a with time type t . Simply a  time/;value pair. Particularly useful with time types that have  non-flat structure. %Time used in futures. The parameter t can be any Ord type. The H added bounds represent -Infinity and +Infinity. Pure values have time H minBound (-Infinity), while never-occurring futures have time maxBound  (+Infinity). "Apply a unary function within the  representation. #Apply a binary function within the  representation. ERun a future in the current thread. Use the given time sink to sync F time, i.e., to wait for an output time before performing the action.   experimentalconal@conal.net 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 at :: ReactiveG t a ->  (t -> a)?. A reactive value may also be thought of (and in this module L is implemented as) a current value and an event (stream of future values). The semantics of  & instances are given by corresponding / instances for the semantic model (functions):  ˜: at (fmap f r) == fmap f (at r), i.e.,  fmap f r at  t == f (r at t).   Applicative: at (pure a) == pure a, and at (s <*> r) == at s  <*> at t . That is, pure a at t == a, and (s <*> r) at t  == (s at t) (r at t).  ™: at (return a) == return a, and at (join rr) == join (at  . at rr) . That is,  return a at t == a, and join rr at t ==  (rr at t) at t. As always, (r >>= f) == join (fmap f r).  at (r >>= f) == at r >>= at . f.  Monoid: a typical lifted monoid. If o is a monoid, then   Reactive o is a monoid, with mempty == pure mempty, and mappend  == liftA2 mappend . That is, mempty at t == mempty, and (r  mappend s) at t == (r at t) mappend (s at t). ;Events. Semantically: time-ordered list of future values.  Instances:  Monoid: mempty% is the event that never occurs, and e mappend  e'- is the event that combines occurrences from e and e'.  ˜: fmap f e# is the event that occurs whenever e occurs, 2 and whose occurrence values come from applying f to the values from  e.   Applicative: pure a. is an event with a single occurrence at time  -Infinity. 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 tf – tx . N.B.: I  don'.t expect this instance to be very useful. If ef has nf  instances and ex has nx instances, then ef <*> ex has nf*nx ' instances. However, there are only nf+nx possibilities for tf  – tx=, so many of the occurrences are simultaneous. If you think 1 you want to use this instance, consider using Reactive instead.  ™: return a is the same as pure a (as usual). In e >>= f,  each occurrence of e leads, through f, to a new event. Similarly  for join ee7, which is somehow simpler for me to think about. The  occurrences of e >>= f (or join ee!) correspond to the union of the I occurrences (temporal interleaving) of all such events. For example,  suppose we'>re playing Asteroids and tracking collisions. Each collision L can 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 event, - whose occurrences contain new events like speak. An especially useful  monad-based function is  joinMaybes, which filters a Maybe-valued  event. #!Apply a unary function inside an   representation. $!Apply a unary function inside an   representation. %"Apply a unary function inside the rEvent part of a Reactive  representation. &;Apply a unary function inside the future reactive inside a Reactive  representation. '&Make the event into a list of futures (ERun an event in the current thread. Use the given time sink to sync F time, i.e., to wait for an output time before performing the action. )FRun an event in a new thread, using the given time sink to sync time. *FRun a reactive value in the current thread, using the given time sink  to sync time. +CRun a reactive value in a new thread, using the given time sink to ? sync time. The initial action happens in the current thread.  !"#$%&'()*+ !"#$'%&(*)+  experimentalconal@conal.net,An improving value. 0$A known improving value (which doesn't really improve) 1Efficient combination of — and '(<=)' 2Efficient combination of – and '(>=)' ,-./012,-./012  experimentalconal@conal.net4  as a function 345345  experimentalconal@conal.net6Make a finite time 7A future's time 8A future's value 9A future value with given time & value :Access time of future 6789:; 6789:;  experimentalconal@conal.netš Merge two  streams into one. <<Reactive value from an initial value and a new-value event. = Switch between reactive values. › Reactive œ (equivalent to œ' but slightly more efficient, I think) >/Access occurrence times in an event. See also ? . ?7Access occurrence times in a reactive value. See also > . @FConvert a temporally monotonic list of futures to an event. See also  the specialization listE A;Convert a temporally monotonic list of futures to an event B Event at given times. See also C . C'Single-occurrence event at given time. D?Snapshot a reactive value whenever an event occurs and apply a - combining function to the event and reactive' s values. E9Accumulating event, starting from an initial value and a " update-function event. See also F . @ Example: (using a list rempresentation for events, for clarity  10 E  G [(5 seconds, (+2)),(10 seconds, (subtract 30)),(20 seconds,(*10))] < = [(5 seconds, 12),(10 seconds, -18),(20 seconds, -180)] % If you want an initial occurance at  -infinity you can use pure a   accumE a e FEReactive value from an initial value and an updater event. See also  E . G'Just the first occurrence of an event. HCDecompose an event into its first occurrence value and a remainder  event. See also I  and J . I:Extract the first occurrence value of an event. See also  H  and J . JFExtract the remainder an event, after its first occurrence. See also  H  and I . K&Remaining part of an event. See also L . L1Access the remainder with each event occurrence. M:Truncate first event at first occurrence of second event. ž(Truncate first event at the given time. NEGet a future representing the first occurrence of the event together 3 with the event of all occurrences after that one. ŸFSample a reactive value at a sequence of monotonically non-decreasing G times. Deprecated, because it does not reveal when value is known to - be repeated in the output. Those values won't be recomputed, but they  may be re-displayed. O Pass through Just occurrences. PPass through values satisfying p.  <=>?@ABCDEFGHIJKLMNOPQRS <=>?A@BCDEFGHIJKLMNOPRQS experimentalconal@conal.net!T?Compatibility synonym (for ease of transition from DataDriven) U;Reactive values, specialized to improving doubles for time V2Events, specialized to improving doubles for time W$Type of future values. Specializes . X.Improving doubles, as used for time values in V, U,  and  ReactiveB. Y The type of finite time values. Z&Trace the elements of a functor type. [*Access occurrence times in an event. See >  for more  general notions of time. \,Single-occurrence event at given time. See ] and C . ])Event occuring at given times. See also \ and C . ^KConvert a temporally monotonic list of timed values to an event. See also  the generalization @  _CGenerate a pair-valued event, given a pair of initial values and a  pair of events. See also pair on U. `Like   for events. a@Accumulate values from a monoid-typed event. Specialization of  `, using  and ”. bCPair each event value with the previous one. The second result is A the old one. Nothing will come out for the first occurrence of e, " but if you have an initial value a , you can do withPrevE (pure a   e). cSame as b., but allow a function to combine the values.  Provided for convenience. dEState machine, given initial value and transition function. Carries  along event data. See also e. TODO: better name. eFState machine, given initial value and transition function. See also  d. fBCount occurrences of an event, remembering the occurrence values.  See also g. gFCount occurrences of an event, forgetting the occurrence values. See  also f. h1Difference of successive event occurrences. See b for a , trick to supply an initial previous value. i4Snapshot a reactive value whenever an event occurs. jLike i" but discarding event data (often a is '()'). kAFilter an event according to whether a reactive boolean is true. lLike   for reactive values. See also `. mAAccumulate values from a monoid-valued event. Specialization of  `, using  and ” . See also a. nCombine two events into one. oStart out blank (¢), latching onto each new a, and blanking  on each b5. If you just want to latch and not blank, then use  ” for lose. p/Flip-flopping reactive value. Turns true when ea occurs and false  when eb occurs. q)Count occurrences of an event. See also f. r"Partition an event into segments. s8Switch from one event to another, as they occur. (Doesn' t merge, as  œ does.) tEuler integral. = .<=>?@ABCDEFGHIJKLMNOPRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv$YXWZV[\]^_`abcdefghUTjiklmnopqrstu.v experimentalconal@conal.netwAReactive behaviors. They can be understood in terms of a simple = model (denotational semantics) as functions of time, namely at ::  BehaviorG t a -> (t -> a). The semantics of w& instances are given by corresponding 4 instances for the semantic model (functions). See   Lhttp://conal.net/blog/posts/simplifying-semantics-with-type-class-morphisms/.  ˜: at (fmap f r) == fmap f (at r), i.e.,  fmap f r at  t == f (r at t).  £: at (pure a) == pure a, and at (s <*> r) == at s  <*> at t . That is, pure a at t == a, and (s <*> r) at t  == (s at t) (r at t).  ™: at (return a) == return a, and at (join rr) == join (at  . at rr) . That is,  return a at t == a, and join rr at t ==  (rr at t) at t. As always, (r >>= f) == join (fmap f r).  at (r >>= f) == at r >>= at . f.  Monoid: a typical lifted monoid. If o is a monoid, then   Reactive o is a monoid, with mempty == pure mempty, and mappend  == liftA2 mappend . That is, mempty at t == mempty, and (r  mappend s) at t == (r at t) mappend (s at t). z(Wrap a reactive time fun as a behavior. {Unwrap a behavior. wxyz{wxyz{ experimentalconal@conal.net|Time-specialized behaviors. O Note: The signatures of all of the behavior functions can be generalized. Is 0 the interface generality worth the complexity? }.The identity generalized behavior. Has value t at time t. ~>Discretely changing behavior, based on an initial value and a  new-value event. Switch between behaviors. €FSnapshots a behavior whenever an event occurs and combines the values & using the combining function passed. 8Snapshot a behavior whenever an event occurs. See also €. ‚Like " but discarding event data (often a is '()'). ƒ?Behavior from an initial value and an updater event. See also  accumE. „Like   for behaviors. See also scanlE. …AAccumulate values from a monoid-valued event. Specialization of  scanlE, using mappend and mempty . See also monoidE. †Like ¤ for behaviors. ‡Start out blank (¢), latching onto each new a, and blanking  on each b5. If you just want to latch and not blank, then use  mempty for the second event. ˆDFlip-flopping behavior. Turns true whenever first event occurs and ) false whenever the second event occurs. ‰)Count occurrences of an event. See also countE. ŠEuler integral. w|}~€‚ƒ„…†‡ˆ‰Šw|}~€‚ƒ„…‡ˆ‰†Š experimentalconal@conal.net‹6Waits a specified duration and then execute an action , type Delay t = t -> forall a. IO a -> IO a DWaits until just after a specified time and then execute an action,  passing in the actual time. & type Schedule t = t -> Sink (Sink t) BA serializing clock. Can (a) produce a time and (b) serialize an  action. EMake a clock, given a way to delay actions. For instance, the delay  could be  sleepThen+ in thread-safe situations, but could also & involve a GUI toolkit wake-up event. „5Get the current time in seconds, relative to a start ¦. ‹ŒŽ‹ŒŽ experimentalconal@conal.net§EIf a sample variable is full, act on the contents, leaving it empty. CMake an action to be executed regularly, given a time-source and a E action-behavior. The generated action is optimized to do almost no : work during known-constant phases of the given behavior. Ø1Pause a thread for the given duration in seconds ‘Sleep past a given time ‘‘ experimentalconal@conal.net’Make a “. “An a that' s fed by a b ©,A value that becomes defined at some time. Ŗ may block if  forced before the time & value are knowable. « says whether D the value is defined at (and after) a given time and likely blocks 2 until the earlier of the query time and the value's actual time. ¬Make a ­©+ and a sink to write to it (at most once). ®­© as Future Æ­© as ,  ”Make a connected sink/4future pair. The sink may only be written to once. •?Make a new event and a sink that writes to it. Uses the given $ clock to serialize and time-stamp. ’“”•”•“’  experimentalconal@conal.net/ EGHIJLMOPVXY[\]^_`abcdefghknrsw|}~€‚ƒ„…†‡ˆ‰Š/YX VE[_`adefghbckn^]\GHIJLMrsOPw|}~€‚ƒ„…‡ˆ‰†Š°!"#$%&'())*++,-./01123456789:; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X S Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m S n opq?6rstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽS‘’“”•–YZaƒ„—˜™š›ŠœŽžŸ ”¢£¤„¦§Ø§©Ŗ«Ŗ¬ ­ ®Æ° ± ²³“µ¶·ø¹ŗ»¼½¾æĄ½ĮĀĆreactive-0.8.3FRP.Reactive.Internal.SerialFRP.Reactive.Internal.IVarData.MaxData.MinData.AddBoundsFRP.Reactive.Internal.FunFRP.Reactive.Internal.MiscFRP.Reactive.Internal.FutureFRP.Reactive.Internal.ReactiveFRP.Reactive.ImprovingFRP.Reactive.FunFRP.Reactive.FutureFRP.Reactive.PrimReactiveFRP.Reactive.ReactiveFRP.Reactive.Internal.BehaviorFRP.Reactive.BehaviorFRP.Reactive.Internal.ClockFRP.Reactive.Internal.TimingFRP.Reactive.Internal.TValData.PairMonadbaseData.Ord Control.Monad Data.Monoid Data.List Data.MaybeControl.ApplicativeFRP.Reactive.NumFRP.Reactive.VectorSpaceold-time-1.0.0.1 System.Time FRP.ReactiveSerial makeSeriallockingIVar newEmptyIVarreadIVar tryReadIVar writeIVarMaxgetMaxMingetMin AddBoundsMaxBoundNoBoundMinBoundFunKSinkActionFutureGFutureunFutureTimeinFuture inFuture2runF ReactiveGStepperEventGEventeFutureinEventinEvent2inREventinFutReFuturesrunEforkErunRforkR ImprovingImpexactcompareIexactlyminImaxIfunapplybatchftimefutTimefutValfuture withTimeFstepperswitcher withTimeGE withTimeGRlistEGfuturesEatTimesGatTimeG snapshotWithaccumEaccumRonce firstRestEfirstErestE remainderR withRestEuntilEeventOcc joinMaybesfilterMP isMonotoneRinfESourceReactiveITimeTimeTtraceF withTimeEatTimeatTimeslistEpairEscanlEmonoidE withPrevE withPrevEWithstateEstateE_countEcountE_diffEsnapshot snapshot_whenEscanlRmonoidReitherEmaybeRflipFlopcountRsplitEswitchEintegralsumR BehaviorGBehunBehbehunbBehaviortimeaccumBscanlBmonoidBsumBmaybeBcountBClockcGetTime cSerialize makeClock mkUpdater sleepPastMkFedFed makeFuture makeEvent GHC.ClassesmaxminGHC.BaseFunctorMonadmergejoinRjoinmappenduntilETratsGHC.ListscanlmemptyNothing Applicativesum currRelTime ClockTimedrainSsleepTValtimeVal definedAtmakeTVal tValFuturetValImp