h$=7      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None5>??None5>?6&dynaEvent stream. The meaning of an event is a callback consumer function. If we give callback to it it will do something useful based on it.The main function is runEvt: runEvt :: Evt m a -> (a -> m ()) -> m () runEvt events callback = ...3Let's look at simple examples of the event streams:"Event that never produce anything: &never = Evt { runEvt _ = pure () }7So it just ignores the callback and returns right away.Event that happens only once: once :: m a -> Evt m a once get = Evt { runEvt go = go =<< get }It just gets the value right away and applies callback to it. We can try it out in the interpreter: 6putStrLns $ fmap ("Your message: " <> ) $ once getLine2We have useful functions to print out the events:  putStrLns and prints.4Also we have event streams that happen periodically: -prints $ clock 1 -- prints time every second## Duplication of the events.Note that event streams are functions that do side-effects within some monad. We use them as values but it means that two values with the same event stream definition can produce different results. For example: %a = toRandomR (0, 10) $ clock 1 b = aNote that a and b will each have their own copy of underlying random event stream. So if you use it in the code don't expect values to be the same.But if we want them to be the same we can copy event from it's definition with function:  newEvt :: Evt m a -> m (Evt m a)It starts the underying event stream process n background and sends all events to the result by channel. With nice property of when we shut down the result event the background process also shuts down. -a <- newEvt toRandomR (0, 10) $ clock 1 b = aIn this example event streams a and b, will have the same events during execution.dynaReference to running dynamic process by which we can query values (readDyn). Also note that we no longer need the reference we should release the resources by calling  cancelDyn.dynaDynamics are step-wise constant effectful functions each step transition is driven by underlying stream of events.Meaning of the Dyn is a process that evolves in time. We can start the process by running runDyn. It produces a reference to the process that runs in background. (runDyn :: Frp m => Dyn m a -> DynRef m aWhen reference is initialized we can query current value of it: readDyn :: DynRef m a -> m aWhen we are done with observations we should shut down the background process with: cancelDyn :: DynRef m a -> m ()It kills the background process and triggers the release function of underlying event stream.dynaevent based dynamicdynaConstant valuedyna!get the value from internal statedynastream of state updatesdyna initial statedynarelease resources for dynamicdynaPipe operator. We often write processors of event streams It makes it convenient write them from first to the last: $evt = proc1 |> proc2 |> ... |> procNInstead of reversed order with ($): !evt = procN $ ... $ proc2 $ proc1dynaRuns dynamic within the scope of the function. It provides a callback with dyn getter as argument and after callback finishes it shutdowns the dyn process. dyna0Dyn that is constructed from effectful callback.!dyna4Event that happens only once and happens right away."dyna7Event that never happens. Callback function is ignored.#dynaRuns the argument event stream as background process and produces event stream that is fed with events over channel (unagi-channel package). When result event stream shuts down the background process also shuts down.$dynaRuns the dynamic process in background and returns dynamic that just samples the background proces with readDyn.%dynaShutdown the remaining event if one of the events close up early.&dyna(Execute each callback in separate thread'dynaAccumulate over event stream.(dynaAccumulate over event stream.)dynaAccumulate over event stream.*dynaAccumulate over event stream.+dyna scan over event stream. Example: naturals = scan (+) 0 pulse,dyna/scan over event stream with effectful function.-dynadynaApplies a function to event stream value. The function is sampled from dynamic process.?dynaEffectful variant of apply.@dynaInfix variant of applyAdynaInfix variant of snap.BdynaApply combined with filter.Cdyna Effectful applyMay.DdynaSnapshot of dynamic process with event stream. All values in the event stream are substituted with current value of dynamic.Edyna(Attach element from dyn to event stream.FdynaKind of zipWith) function for dynamics and event streams.GdynaAttach with filtering. When Nothing. is produced event is omitted from the stream.HdynaMap with filtering. When Nothing. is produced event is omitted from the stream.Idyna Effectful mapMayJdynaFiltering of the event strewams. Only events that produce True remain in the stream.Kdyna&Effectful filtering for event streams.LdynaFilters based on Maybe. If Nothing8 is produced forthe event it is omitted from the stream.MdynaFilters with dynamic. When dynamic is true events pass through and when it's false events are omitted.NdynaSplits the either event stream.Odyna$Gets all left events from the streamPdyna%Gets all right events from the streamQdyna)Takes only so many events from the streamRdyna*Drops first so many events from the streamSdyna*Takes events only while predicate is true.Tdyna%Drops events while predicate is true.UdynaTakes elements from the list by index. If index is out of bounds the event is omitted.VdynaTurns event stream to toggle stream. It produce cyclic sequence of [True, False]Wdyna/Cycles the values in the list over event sream.Xdyna)Sums all the elements in the event streamYdyna1Integrates signal of vectors with given time stepZdynaMore accurate integration of signal of vectors with given time step[dyna2Sums all points in the signal with given time step\dyna6Finds the product of all elements in the event stream.]dyna-Monoidal append of all elements in the stream^dyna!Same as foldMap only for streams._dynaMonoidal fold for event streams, note that stream have to be finite for the function to complete`dynaLeft fold for event streams, note that stream have to be finite for the function to completeadynaEffectful left foldbdynaRight fold for event streams, note that stream have to be finite for the function to completecdynaEffectful right foldddyna=Starts event stream process and as callback prints it values.edyna=Starts event stream process and as callback prints it values.fdynaStream of user inputsgdynaQueries the event stream form dynamic and runs it all next event streams are ignored.hdynaJoins event stream of streams. If stream is started it runs until the end.idynaRecursion on event streams. As event streams are functions we can not use normal recursion that haskell provides. It will stuck the execution. But we can use fix1= to create event stream that feeds back the events to itself.8Note that any sort of recursion can be implemented with fix13. For example if we need 3-recursive event stream: fix3 :: (Evt m a -> Evt m b -> Evt m c -> m (Evt m a, Evt m b, Evt m c)) -> (Evt m a, Evt m b, Evt m c)6we can use sum tpye tags to join it to single stream: )data Tag a b c = TagA a | TagB b | TagC c fix3 f = unwrap $ fix1 g where g x = wrap <$> f (unwrapA x) (unwrapB x) (unwrapC x) wrap a b c = mconcat [TagA <$> a, TagB <$> b, TagC <$> c] unwrap evt = (unwrapA evt, unwrapB evt, unwrapC evt) unwrapA = flip mapMay $ \x -> case x of TagA a -> Just a _ -> NothingWe can use this trck with any number of streams. There are helper functions: fix2, fix3, fix4jdynaRecursion for binary functionskdynaRecursion for ternary functionsldyna)Recursion for functions of four argumentsmdynaFlattens event stream producer by switching between event streams. When next event stream happens it shuts down the previous one.ndyna#Switches between dynamic producers.odynaCreates the event stream that listens to MVar based channel. If any value is put chan the event stream fires the callback.pdyna)Creates the event stream that listens to TChan based channel. If any value is put chan the event stream fires the callback.qdynaCreates the event stream that listens to unagi channel (package  unagi-chan). If any value is put chan the event stream fires the callback.rdyna?Queries current time periodically with given period in seconds.sdyna3Produces pulse events with given period in seconds.tdynaProduces pulse events with given period in seconds and also tells how many seconds exactly has passed. It can be useful for simulations of models that are based on differential equations. As event streams carries how much time has passed between simulation steps.udynaTimer behaves like tocks only it produces accumulated time since beginning of the process. It calculates them by querying current time and suntracting start time from it.It can be though of as:  sums ticksvdynaTimer as dynamic signal.wdyna6Substitutes values in event stream with random values.xdynaSubstitutes values in event stream with random values from the given range.ydyna6Substitutes values in event stream with random values.zdynaSubstitutes values in event stream with random values from the given range.{dyna)Picks at random one element from the list|dyna)Picks at random one element from the list}dynaPicks at random one element from the list. We also provide distribution of events. Probability to pick up the element. Sum of probabilities should equal to 1.~dynaPicks at random one element from the list. We also provide distribution of events. Probability to pick up the element. Sum of probabilities should equal to 1.dynaSkips at random elements from the list. We provide frequency to skip events with dynamic first argument.dynaSkips elements at random. The probability to skip element depends on the element itself.dynaDelays in the thread of execution. Note that it can interfere and screw up functions like clock, timer, pulse, ticksdynaDelays in background by forking on each event. Note tht if delayed event was put into background prior to stopping of the main event stream it will fire anyway. There is no way to stop it.dyna+Takes an event and repeats it all the time.dynaReads single eventdynaTakes first element of the event stream and shuts the stream down.dynaCreate a new Event and a function that will cause the Event to fire  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!" 423#$+-H':)JLMNOP/0ijklmhX[YZ\67]^QRSTWUV%&de_`abc 589;ng>BDEFG@A <=1,.(*KI?Copqfrstuvwxyz{|}~ 0@4A4      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#dyna-0.1.0.0-K9bJYPEWtvm3uoVHdBjnA0DynaDyna.RefbaseGHC.BaseliftA3liftA2IsRefnewRefreadRefwriteRef modifyRef $fIsRefTVar $fIsRefIORefParser BasisArity basisArityFunctorMfmap'UChanEvtrunEvtDynRefConstRefDynConstDyndyn'getdyn'evtdyn'init dyn'releaseFrpRef|>withDynconstDynoncenevernewEvtnewDynracesforksaccumaccum'accumMay accumMay'scanscan'scanMayscanMay'iterates withIterates iterates'readDyn cancelDynrunDynholdcount withCountunholdscanDaccumBscanMayDforeachposteachapplyapply'<@><@applyMay applyMay'snapattach attachWith attachWithMaymapMaymapMay'filtersfilters' filterJustwhenssplitsleftsrightstakesdrops takesWhile dropsWhilelistAttoTogglecyclessums integrate integrate2sumDproductsappendsfoldMapsfoldsfoldlsfoldls'foldrsfoldrs'prints putStrLnsgetLines switchDynjoinsfix1fix2fix3fix4switchswitchDmchanEvttchanEvtuchanEvtclockpulsetickstimertimerDtoRandom toRandomR withRandom withRandomRoneOf withOneOffreqOf withFreqOfrandSkip randSkipBydelay delayForkforevers runParserheadstakePcyclePheadPmaybeP newTriggerEvt$fFrpIO $fLimitEvt $fLoopEvt $fComposeEvt $fHarmonyEvt $fMelodyEvt $fMonadEvt$fApplicativeEvt $fMonoidEvt$fSemigroupEvt $fFunctorEvt$fHasCross3Dyn$fHasCross2Dyn$fHasNormalDyn$fAffineSpaceDyn$fVectorSpaceDyn$fAdditiveGroupDyn $fOrdBDyn$fEqBDyn$fIfBDyn $fBooleanDyn $fIsStringDyn $fMonoidDyn$fSemigroupDyn$fFractionalDyn$fNumDyn$fApplicativeDyn $fFunctorDyn $fFunctorMDyn $fFunctorMEvt $fHasBasisDyn$fBasisArityDyn$fBasisArity(,,)$fBasisArity(,)$fBasisArityDouble$fBasisArityFloat$fApplicativeParser$fFunctorParser $fFunctorSt+temporal-media-0.6.3-KLuDeiL0qJfClCS0R8ZfFKTemporal.ClassharMapmelMap*|+|loopByDurationdurDurOfMelodymel+:+Harmonyhar=:=ComposeDelaydelStretchstrRestrestLimitlimLooploop(vector-space-0.16-8Cr26VVqud68FrZK9851o0 Data.Crossnormal HasNormal normalVecOneTwoThree HasCross2cross2 HasCross3cross3Data.AffineSpace affineComboalerpdistance distanceSq.-^Diff AffineSpace.+^.-.Data.VectorSpaceproject normalized magnitude magnitudeSq linearCombolerp^*^/Scalar VectorSpace*^ InnerSpace<.>Data.AdditiveGroupinSum2inSumsumV AdditiveGroup^-^negateVzeroV^+^SumgetSum