Îõ³h&HqD¨¨      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§ Safe-Inferred×Ü@(ÍJ bearriver“A single possible event occurrence, that is, a value that may or may not occur. Events are used to represent values that are not produced continuously, such as mouse clicks (only produced when the mouse is clicked, as opposed to mouse positions, which are always defined).M bearriver$Information on the progress of time.N bearriver´Extensible signal function (signal function with a notion of time, but which can be extended with actions). Signal function that transforms a signal carrying values of some type a- into a signal carrying values of some type bÞ. You can think of it as (Signal a -> Signal b). A signal is, conceptually, a function from P to value.O bearriver¢DTime is the time type for lengths of sample intervals. Conceptually, DTime = R+ = { x in R | x > 0 }. Don't assume Time and DTime have the same representation.P bearriveræTime is used both for time intervals (duration), and time w.r.t. some agreed reference point in time.Q bearriverÁLifts a pure function into a signal function (applied pointwise).R bearriverÔLifts a pure function into a signal function applied to events (applied pointwise).S bearriverIdentity: identity = arr idUsing SŽ is preferred over lifting id, since the arrow combinators know how to optimise certain networks based on the transformations being applied.T bearriver$Identity: constant b = arr (const b)Using T‘ is preferred over lifting const, since the arrow combinators know how to optimise certain networks based on the transformations being applied.U bearriverÇOutputs the time passed since the signal function instance was started.V bearriverAlternative name for localTime.W bearriver5Initialization operator (cf. Lustre/Lucid Synchrone).†The output at time zero is the first argument, and from that point on it behaves like the signal function passed as second argument.X bearriverOutput pre-insert operator.ÑInsert a sample in the output, and from that point on, behave like the given sf.Y bearriverInput initialization operator.…The input at time zero is the first argument, and from that point on it behaves like the signal function passed as second argument.\ bearriver‰Applies a function point-wise, using the last output as next input. This creates a well-formed loop based on a pure, auxiliary function.] bearriverGeneric version of \Ù, in which the auxiliary function produces an internal accumulator and an "held" output.4Applies a function point-wise, using the last known ¨Ê output to form the output, and next input accumulator. If the output is ©î, the last known accumulators are used. This creates a well-formed loop based on a pure, auxiliary function.^ bearriverEvent source that never occurs._ bearriverëEvent source with a single occurrence at time 0. The value of the event is given by the function argument.` bearriverÇEvent source with a single occurrence at or as soon after (local) time q as possible.a bearriverÛEvent source with repeated occurrences with interval q. Note: If the interval is too short w.r.t. the sampling intervals, the result will be that events occur at every sample. However, no more than one event results from any sampling interval, thus avoiding an "event backlog" should sampling become more frequent at some later point in time.b bearriverËEvent source with consecutive occurrences at the given intervals. Should more than one event be scheduled to occur in any sampling interval, only the first will in fact occur to avoid an event backlog.c bearriverÕEvent source with consecutive occurrences at the given intervals. Should more than one event be scheduled to occur in any sampling interval, the output list will contain all events produced during that interval.d bearriver Apply an ?6 to every input. Freezes temporarily if the input is L, and continues as soon as an J is received.g bearriverÜA rising edge detector. Useful for things like detecting key presses. It is initialised as upÀ, meaning that events occurring at time 0 will not be detected.h bearriver6A rising edge detector that can be initialized as up (ªË, meaning that events occurring at time 0 will not be detected) or down («<, meaning that events occurring at time 0 will be detected).i bearriverLike g%, but parameterized on the tag value. From Yampaj bearriverÀEdge detector particularized for detecting transtitions on a ¬ signal from © to ¨. From Yampak bearriverÖEdge detector parameterized on the edge detection function and initial state, i.e., the previous input sample. The first argument to the edge detection function is the previous sample, the second the current one.l bearriver$Convert a maybe value into a event (J is isomorphic to ¬).n bearriver/Suppression of initial (at local time 0) event.o bearriver!Suppress all but the first event.p bearriver$Suppress all but the first n events.q bearriverSuppress first n events.r bearriver“Make the NoEvent constructor available. Useful e.g. for initialization, ((-->) & friends), and it's easily available anyway (e.g. mergeEvents []).s bearriver4Suppress any event in the first component of a pair.t bearriver5Suppress any event in the second component of a pair.u bearriver-An event-based version of the maybe function.v bearriver)z bearriverÍTags an (occurring) event with a value ("replacing" the old value). Same as y with the arguments swapped.-Applicative-based definition: tagWith = (<$){ bearriver;Attaches an extra value to the value of an occurring event.| bearriver?Left-biased event merge (always prefer left event, if present).} bearriverÁRight-biased event merge (always prefer right event, if present).~ bearriver:Unbiased event merge: simultaneous occurrence is an error.€ bearriverÖA generic event merge-map utility that maps event occurrences, merging the results. The first three arguments are mapping functions, the third of which will only be used when both events are present. Therefore,  = € ­ ­=Applicative-based definition: mapMerge lf rf lrf le re = (f  $ le  * re)  | (lf  $ le)  | (rf  $ re) bearriver4Merge a list of events; foremost event has priority.äFoldable-based definition: mergeEvents :: Foldable t => t (Event a) -> Event a mergeEvents = asum‚ bearriver9Collect simultaneous event occurrences; no event if none.Traverable-based definition: catEvents :: Foldable t => t (Event a) -> Event (t a) carEvents e = if (null e) then NoEvent else (sequenceA e)ƒ bearriverÏJoin (conjunction) of two events. Only produces an event if both events exist.1Applicative-based definition: joinE = liftA2 (,)„ bearriver+Split event carrying pairs into two events.… bearriver4Filter out events that don't satisfy some predicate.† bearriver2Combined event mapping and filtering. Note: since J is a ®, see ¯: for a simpler version of this function with no filtering.‡ bearriver?Enable/disable event occurences based on an external condition.ˆ bearriver Basic switch.¼By default, the first signal function is applied. Whenever the second value in the pair actually is an event, the value carried by the event is used to obtain a new signal function to be applied *at that time and at future times*. Until that happens, the first value in the pair is produced in the output signal.³Important note: at the time of switching, the second signal function is applied immediately. If that second SF can also switch at time zero, then a double (nested) switch might take place. If the second SF refers to the first one, the switch might take place infinitely many times and never be resolved.ËRemember: The continuation is evaluated strictly at the time of switching!‰ bearriver Switch with delayed observation.1By default, the first signal function is applied.¥Whenever the second value in the pair actually is an event, the value carried by the event is used to obtain a new signal function to be applied *at future times*.ÒUntil that happens, the first value in the pair is produced in the output signal.ÄImportant note: at the time of switching, the second signal function is used immediately, but the current input is fed by it (even though the actual output signal value at time 0 is discarded).ØIf that second SF can also switch at time zero, then a double (nested) -- switch might take place. If the second SF refers to the first one, the switch might take place infinitely many times and never be resolved.ËRemember: The continuation is evaluated strictly at the time of switching!Š bearriver…Spatial parallel composition of a signal function collection. Given a collection of signal functions, it returns a signal function that broadcasts its input signal to every element of the collection, to return a signal carrying a collection of outputs. See par.?For more information on how parallel composition works, check ,https://www.antonycourtney.com/pubs/hw03.pdf‹ bearriverúDecoupled parallel switch with broadcasting (dynamic collection of signal functions spatially composed in parallel). See dpSwitch.?For more information on how parallel composition works, check ,https://www.antonycourtney.com/pubs/hw03.pdfŒ bearriver'Apply an SF to every element of a list.Example:Õembed (parC integral) (deltaEncode 0.1 [[1, 2], [2, 4], [3, 6], [4.0, 8.0 :: Float]]))[[0.0,0.0],[0.1,0.2],[0.3,0.6],[0.6,1.2]]òThe number of SFs or expected inputs is determined by the first input list, and not expected to vary over time.;If more inputs come in a subsequent list, they are ignored.åembed (parC (arr (+1))) (deltaEncode 0.1 [[0], [1, 1], [3, 4], [6, 7, 8], [1, 1], [0, 0], [1, 9, 8]])[[1],[2],[4],[7],[2],[1],[2]]ÁIf less inputs come in a subsequent list, an exception is thrown.èembed (parC (arr (+1))) (deltaEncode 0.1 [[0, 0], [1, 1], [3, 4], [6, 7, 8], [1, 1], [0, 0], [1, 9, 8]]),[[1,1],[2,2],[4,5],[7,8],[2,2],[1,1],[2,10]] bearriverZero-order hold.ŠConverts a discrete-time signal into a continuous-time signal, by holding the last value until it changes in the input signal. The given parameter may be used for time zero, and until the first event occurs in the input signal, so hold is always well-initialized.×embed (hold 1) (deltaEncode 0.1 [NoEvent, NoEvent, Event 2, NoEvent, Event 3, NoEvent]) [1,1,2,2,3,3]Ž bearriver7Accumulator parameterized by the accumulation function. bearriverÇZero-order hold accumulator parameterized by the accumulation function. bearriver9Loop with an initial value for the signal being fed back.‘ bearriver%Integration using the rectangle rule.’ bearriver¡Integrate using an auxiliary function that takes the current and the last input, the time between those samples, and the last output, and returns a new output.“ bearriverûA very crude version of a derivative. It simply divides the value difference by the time difference. Use at your own risk.– bearriver«Stochastic event source with events occurring on average once every t_avg seconds. However, no more than one event results from any one sampling interval in the case of relatively sparse sampling, thus avoiding an "event backlog" should sampling become more frequent at some later point in time.— bearriverûConvenience function to run a signal function indefinitely, using a IO actions to obtain new input and process the output.ûThis function first runs the initialization action, which provides the initial input for the signal transformer at time 0.ŒAfterwards, an input sensing action is used to obtain new input (if any) and the time since the last iteration. The argument to the input sensing function indicates if it can block. If no new input is received, it is assumed to be the same as in the last iteration.ÝAfter applying the signal function to the input, the actuation IO action is executed. The first argument indicates if the output has changed, the second gives the actual output). Actuation functions may choose to ignore the first argument altogether. This action should return True if the reactimation must stop, and False if it should continue.%Note that this becomes the program's  main loop£, which makes using this function incompatible with GLUT, Gtk and other graphics libraries. It may also impose a sizeable constraint in larger projects in which different subparts run at different time steps. If you need to control the main loop yourself for these or other reasons, use  reactInit and react.˜ bearriver;Evaluate an SF, and return an output and an initialized SF.WARNÿ: Do not use this function for standard simulation. This function is intended only for debugging/testing. Apart from being potentially slower and consuming more memory, it also breaks the FRP abstraction by making samples discrete and step based.™ bearriverÄEvaluate an initialized SF, and return an output and a continuation.WARNÿ: Do not use this function for standard simulation. This function is intended only for debugging/testing. Apart from being potentially slower and consuming more memory, it also breaks the FRP abstraction by making samples discrete and step based.š bearriver‘Given a signal function and time delta, it moves the signal function into the future, returning a new uninitialized SF and the initial output.•While the input sample refers to the present, the time delta refers to the future (or to the time between the current sample and the next sample).WARNÿ: Do not use this function for standard simulation. This function is intended only for debugging/testing. Apart from being potentially slower and consuming more memory, it also breaks the FRP abstraction by making samples discrete and step based. bearriverNFData instancež bearriverAlternative instanceŸ bearriverMonadFail instance  bearriver The type J is isomorphic to ¬. The ° instance of J is analogous to the ° instance of ¬$, where the lack of a value (i.e., L#) causes bind to produce no value (L).¡ bearriver The type J is isomorphic to ¬. The ± instance of J is analogous to the ± instance of ¬$, where the lack of a value (i.e., L ) causes ² to produce no value (L).¢ bearriver The type J is isomorphic to ¬. The ® instance of J is analogous to the Functo instance of ¬?, where the given function is applied to the value inside the J , if any.` bearriver The time q) after which the event should be produced bearriverValue to produce at that time– bearriver The time q4 after which the event should be produced on average bearriver!Value to produce at time of event   !"#$%&'()*+,-./0123456789:;<=>?I@ABCDEFHGJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œÓPONMJKLQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œW0X0Y0Z0Ô(c) Ivan Perez, 2019-2022 (c) Ivan Perez and Manuel Baerenz, 2016-2018BSD3ivan.perez@keera.co.uk Safe-InferredC(¦ bearriverâFuture signal function (conceptually, a function between fugure signals that respects causality).ÄA future signal is a signal that is only defined for positive times.§ bearriverÔSignal function (conceptually, a function between signals that respects causality).ž   !"#$%&'()*+,-./0123456789:;<=>?I@ABCDEFHGJKLMOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œ¦§ž   !"#$%&'()*+,-./0123456789:;<=>?I@ABCDEFHGJKLMOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œ§¦³       !"!#$%&$%'$%($%)$%*$%+$%,$%-$%.$%/$%0$%1$%2$%3$%4$%5$%6$%7$%8$%9$:;$:<$:=$:>$:?$:@$:A$:B$CD$CE$CF$CGHIJHIKHILHIMHINHIOHIPHIQHIRHISTTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯W°±°²³´µ³´¶°·¸¹¸º¸»¸¼¸½¸¾¿%bearriver-0.14-7YuQ2VS1eIT4NjhIClynCb FRP.Yampa FRP.BearRiverbase Control.Arrowarrfirstapp|||loop runKleisliKleisli zeroArrow ArrowZero<+> ArrowPlus ArrowMonad ArrowLooprightleft+++ ArrowChoice ArrowApplysecond***&&&ArrowreturnAleftApp^>>^<<>>^<<^Control.Category>>><<<"dunai-0.9.2-FXMpE0tjq366ZnfdVi2QVkData.MonadicStreamFunction.UtilpauseOn traceWhen traceWithunfoldmealyaccumulateWith mappendFrommappendSsumFromsumScountfifonextiPostiPrewithSideEffect_withSideEffect mapMaybeSMStreamMSinkData.MonadicStreamFunction.CoremorphS liftTransS>>>^^>>> liftBaseS liftBaseMarrMconstM'Data.MonadicStreamFunction.InternalCoreembedfeedbackmorphGSMSF-simple-affine-space-0.2-lPMaEayLG010C8Q73yHwFData.VectorSpace normalizenormdot negateVector^-^^+^^/*^ zeroVector VectorSpaceEventNoEvent ClockInfoSFDTimeTimearrPrimarrEPrimidentityconstant localTimetime-->-:>>-->=- initiallysscan sscanPrimnevernowafter repeatedly afterEach afterEachCat mapEventS eventToMaybe boolToEventedgeiEdgeedgeTagedgeJustedgeBy maybeToEventedgeFromnotYetonce takeEvents dropEventsnoEvent noEventFst noEventSndevent fromEventisEvent isNoEventtagtagWithattachlMergerMergemergemergeBymapMerge mergeEvents catEventsjoinEsplitEfilterE mapFilterEgateswitchdSwitchparB dpSwitchBparCholdaccumBy accumHoldByloopPreintegral integralFrom derivativederivativeFromiterFrom occasionally reactimate evalAtZeroevalAt evalFuture replaceOncedup $fNFDataEvent$fAlternativeEvent$fMonadFailEvent $fMonadEvent$fApplicativeEvent$fFunctorEvent $fEqEvent $fOrdEvent $fShowEventFutureSF GHC.MaybeJustNothingghc-prim GHC.TypesTrueFalseMaybeGHC.BaseidFunctorfmapMonad Applicative<*>