úÎ!^¯E·ÿ±      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔ Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æçèéêëìíîïðñòóôõö÷øùúûüýþÿ      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„ … † ‡ ˆ ‰ Š!‹!Œ!Ž‘’“”•–—˜™š›œ"ž"Ÿ" "¡#¢#£#¤#¥#¦#§#¨#©#ª#«#¬#­#®#¯$°$(Safe4$Ågrhine Values in ScheduleT diff m/ are delayed computations with side effects in mM. Delays can occur between any two side effects, with lengths specified by a diffL value. These delays don't have any semantics, it can be given to them with k.hrhine6A functor implementing a syntactical "waiting" action.diff! represents the duration to wait.a is the encapsulated value.jrhine2The side effect that waits for a specified amount.krhineSupply a semantic meaning to h. For every occurrence of  Wait diff in the ScheduleT diff m a6 value, a waiting action is executed, depending on diff.lrhineRun a g value in a ,, interpreting the times as milliseconds.mrhineRuns two values in g concurrently and returns the first one that yields a value (defaulting to the first argument), and a continuation for the other value.nrhineFRuns both schedules concurrently and returns their results at the end.ghijklmnhigjklmn%Safe&DZrhine Commute a ² layer past an X layer.³rhineCommute the effects of the ² and the X monad.±³&Safe'º´rhine Commute one ² layer past a µ layer.´'Safe)#prhineDIn a composite running clock, duplicate the tick of one subclock.pqNone=?HMV,œrrhineAny ¶ can be wrapped to form a u.urhineŽA time domain is an affine space representing a notion of time, such as real time, simulated time, steps, or a completely different notion.crstuvwrstuvwcNone"#=>?@AHPSVX]½!rhineLift a clock type into .€rhine+Lift a clock type into a monad transformer.rhine-Applying a monad morphism yields a new clock.…rhineŠInstead of a mere function as morphism of time domains, we can transform one time domain into the other with a monadic stream function.‡rhineThe clock before the rescalingˆrhinekThe rescaling stream function, and rescaled initial time, depending on the initial time before rescaling‰rhine†Instead of a mere function as morphism of time domains, we can transform one time domain into the other with an effectful morphism.‹rhineThe clock before the rescalingŒrhine4Computing the new time effectfully from the old timerhine7Applying a morphism of time domains yields a new clock.‘rhineLike ’`, but allows for an initialisation of the rescaling morphism, together with the initial time.’rhine6An effectful, stateful morphism of time domains is an LU that uses side effects to rescale a point in one time domain into another one.“rhineAn effectful morphism of time domains is a Kleisli arrow. It can use a side effect to rescale a point in one time domain into another one.”rhine3A pure morphism of time domains is just a function.•rhineAn annotated, rich time stamp.—rhineTime passed since the last tick˜rhine1Time passed since the initialisation of the clock™rhine%The absolute time of the current tickšrhine&The tag annotation of the current tick›rhine}Since we want to leverage Haskell's type system to annotate signal networks by their clocks, each clock must be an own type, cl‘. Different values of the same clock type should tick at the same speed, and only differ in implementation details. Often, clocks are singletons.œrhine@The time domain, i.e. type of the time stamps the clock creates.rhine§Additional information that the clock may output at each tick, e.g. if a realtime promise was met, if an event occurred, if one of its subclocks (if any) ticked.žrhine’The method that produces to a clock value a running clock, i.e. an effectful stream of tagged time stamps together with an initialisation time.ŸrhineWhen initialising a clock, the initial time is measured (typically by means of a side effect), and a running clock is returned. rhinesA clock creates a stream of time stamps and additional information, possibly together with side effects in a monad mH that cause the environment to wait until the specified time is reached.¡rhine$A utility that changes the tag of a •.¢rhineMGiven a clock value and an initial time, generate a stream of time stamps.£rhineoConvert an effectful morphism of time domains into a stateful one with initialisation. Think of its type as 4RescalingM m cl time -> RescalingSInit m cl time tag%, although this type is ambiguous.¤rhineA  is trivially a ‰.¥rhineA ‰ is trivially a ….¦rhineA  is trivially a ….§rhine,Lift a clock value into a monad transformer.¨rhineLift a clock value into .žrhine>The clock value, containing e.g. settings or device parametersrhine/The stream of time stamps, and the initial timer  !",-./0123456789:;<=>?@ABCDEFGHIJKLcrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨r€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨  !",-./0123456789:;<=>?@ABCDEFGHIJKLcrstuvwNone"#&'=>?@AHSVXØ­rhineGAn inclusion of a clock into a tree of parallel compositions of clocks.±rhine`A tree representing possible last times to which the constituents of a clock may have ticked.µrhineCThe clock that represents the rate at which data leaves the system.¶rhineCThe clock that represents the rate at which data enters the system.·rhineAbbrevation synonym.¸rhineuTwo clocks can be combined with a schedule as a clock for an asynchronous parallel composition of signal networks.½rhineAbbrevation synonym.¾rhinewTwo clocks can be combined with a schedule as a clock for an asynchronous sequential composition of signal networks.ÃrhineUA schedule implements a combination of two clocks. It outputs a time stamp and an ·A value, which specifies which of the two subclocks has ticked.Ærhine'Lift a schedule along a monad morphism.Çrhine&Swaps the clocks for a given schedule.Èrhine^If a schedule works for two clocks, a rescaling of the clocks also applies to the schedule.ÉrhineAs È, with a stateful rescalingÊrhineLifts a schedule into the ²H transformer, supplying the same environment to its scheduled clocks.Ërhinecl1 is a subclock of SequentialClock m cl1 cl2, therefore it is always possible to schedule these two clocks deterministically. The left subclock of the combined clock always ticks instantly after cl1.ÌrhineAs Ëh, but for the right subclock. The right subclock of the combined clock always ticks instantly before cl2.ÍrhineLike Ëc, but for parallel clocks. The left subclock of the combined clock always ticks instantly after cl1.ÎrhineLike ÍH, but the left subclock of the combined clock always ticks instantly before cl1.ÏrhineLike Íh, but for the right subclock. The right subclock of the combined clock always ticks instantly before cl2.ÐrhineLike ÍI, but the right subclock of the combined clock always ticks instantly after cl2.ÑrhinehGenerates a tag for the composite clock from a tag of a leaf clock, given a parallel clock inclusion.%­°¯®±´³²µ¶·¸¹¼»º½¾¿ÂÁÀÃÄÅÆÇÈÉÊËÌÍÎÏÐÑ%ÃÄÅÆÇÈÉʾ¿ÂÁÀ½Ë̸¹¼»º·ÍÎÏжµ±´³²­°¯®Ñ None"#>HV…ªÔrhineTwo clocks in the gd monad transformer can always be canonically scheduled. Indeed, this is the purpose for which g was defined.ÔÔ None>HVŠÕrhineäRuns two clocks in separate GHC threads and collects the results in the foreground thread. Caution: The data processing will still happen in the same thread (since data processing and scheduling are separated concerns).ÖrhineAs Õ , but in the  WriterT w IOs monad. Both background threads share a joint variable with the foreground to which the writer effect writes.×rhineSchedule in the  ExceptT e IO9 monad. Whenever one clock encounters an exception in X3, this exception is thrown in the other clock's XK layer as well, and in the schedule's (i.e. in the main clock's) thread.ØrhineAs ×), with a single possible exception value.ÕÖרÕÖר None"#HSVXšûÙrhine)A type synonym to allow for abbreviation.Úrhine%A stateful buffer from which one may Ý a value, or to which one may Ü# a value, depending on the clocks. Ú:s can be clock-polymorphic, or specific to certain clocks.m: Monad in which the Ú may have side effectscla+: The clock at which data enters the bufferclb+: The clock at which data leaves the buffera: The input typeb: The output typeÜrhineStore one input value of type a5 at a given time stamp, and return a continuation.Ýrhine"Retrieve one output value of type b. at a given time stamp, and a continuation.ÞrhineHoist a Ú along a monad morphism.x  !",-./0123456789:;<=>?@ABCDEFGHIJKLcrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨ÙÚÛÝÜÞÙÚÛÝÜÞ None"#¨“ßrhine†An asynchronous, effectful Mealy machine description. (Input and output do not happen simultaneously.) It can be used to create Ús.árhineBGiven the previous state and an input value, return the new state.ârhineAGiven the previous state, return an output value and a new state.ãrhine´A resampling buffer that is unaware of the time information of the clock, and thus clock-polymorphic. It is built from an asynchronous Mealy machine description. Whenever Ý is called on "timelessResamplingBuffer machine s, the method â is called on machine with state s0, discarding the time stamp. Analogously for Ü.ärhine6A resampling buffer that only accepts and emits units.ãrhineThe initial stateßàâáãäßàâáãä None"#¯~århineZGiven a monadic stream function that accepts a varying number of inputs (a list), a Ú@ can be formed that collects all input in a timestamped list.århineÓThe monadic stream function that consumes a single time stamp for the moment when an output value is required, and a list of timestamped inputs, and outputs a single value. The list will contain the newest element in the head.ååNone"#´dærhineDAn unbounded LIFO buffer. If the buffer is empty, it will return ¸.çrhine‰A bounded LIFO buffer that forgets the oldest values when the size is above a given threshold. If the buffer is empty, it will return ¸.èrhine<An unbounded LIFO buffer that also returns its current size.æçèæçèNone"#·gérhine\Always keeps the last input value, or in case of no input an initialisation value. If cl2A approximates continuity, this behaves like a zero-order hold.ééNone"#¼QêrhineDAn unbounded FIFO buffer. If the buffer is empty, it will return ¸.ërhineŠA bounded FIFO buffer that forgets the oldest values when the size is above a given threshold. If the buffer is empty, it will return ¸.ìrhine<An unbounded FIFO buffer that also returns its current size.êëìêëìNone"#Æ írhineiCollects all input in a list, with the newest element at the head, which is returned and emptied upon Ý.îrhineReimplementation of íg with sequences, which gives a performance benefit if the sequence needs to be reversed or searched.ïrhineïj collects all input values lazily in a list and processes it when output is required. Semantically, "pureBuffer f == collect >>-^ arr f , but ï is slightly more efficient.ðrhinegA buffer collecting all incoming values with a folding function. It is strict, i.e. the state value b is calculated on every Ü.ðrhineThe folding functionrhineThe initial valueíîïðíîïðNone "#=?@AHPVÑñrhine/A clock that selects certain subevents of type a", from the tag of a main clock.If two ñ`s would tick on the same type of subevents, but should not have the same type, one should newtype the subevent.órhineThe main clock | Return ¸^ if no tick of the subclock is required, or 'Just a' if the subclock should tick, with tag a.õrhine[A universal schedule for two subclocks of the same main clock. The main clock must be a ¹ (e.g. a singleton).örhine7A universal schedule for a subclock and its main clock.÷rhineHelper function that runs an L with º$ output until it returns a value.ñòóôõö÷ñòóôõö÷None=?@AHVÓOùrhine]A clock that ticks for every line entered on the console, outputting the entered line as its .ùúùúNone@AHVÖ7ýrhine•A clock that ticks without waiting. All time passed between ticks amounts to computation time, side effects, time measurement and framework overhead.ýþýþNone .=?@AHVë rhineA rescaled version of  with u ».rhineWA side-effect free clock for audio synthesis and analysis. The sample rate is given by rate (of type ÿ). Since this clock does not wait for the completion of buffers, the producer or the consumer of the signal has the obligation to synchronise the signal with the system clock, if realtime is desired. Otherwise, the clock is also suitable e.g. for batch processing of audio files.rhine]A clock for audio analysis and synthesis. It internally processes samples in buffers of size  bufferSizeJ, (the programmer does not have to worry about this), at a sample rate of rate (of type ‰). Both these parameters are in the type signature, so it is not possible to compose signals with different buffer sizes or sample rates.÷After processing a buffer, the clock will wait the remaining time until the next buffer must be processed, using system UTC time. The tag of the clock specifies whether the attempt to finish the last buffer in real time was successful. A value of ¸ represents success, a value of  Just double represents a lag of double seconds.rhine3Rates at which audio signals are typically sampled.¼rhine Converts an ! to its corresponding rate as an ½. rhineA rescaled version of  with u » , using ¾ to rescale.   None&'-.=>?@AHUVñrhineeA clock whose tick lengths cycle through a (nonempty) list of type-level natural numbers. E.g. Periodic '[1, 2]& ticks at times 1, 3, 4, 5, 7, 8, etc.&The waiting side effect is formal, in g. You can use e.g. l to produce an actual delay.¿rhine8Repeatedly outputs the values of a given list, in order.NoneHSVXàrhine(Compatibility to U.S. american spelling.rhineƒA (side-effectful) behaviour function is a time-aware synchronous stream function that doesn't depend on a particular clock. time denotes the u.rhine(Compatibility to U.S. american spelling.rhineeA (side-effectful) behaviour is a time-aware stream that doesn't depend on a particular clock. time denotes the u.rhineA clocked signal is a > with no input required. It produces its output on its own.rhine‰A (synchronous, clocked) monadic stream function with the additional side effect of being time-aware, that is, reading the current • of the clock cl.rhineHoist a  along a monad morphism.rhineHoist a & and its clock along a monad morphism.rhineLift a  into a monad transformer.rhineLift a ( and its clock into a monad transformer.rhine=A monadic stream function without dependency on time is a  for any clock.rhine+Utility to lift Kleisli arrows directly to s. rhineVersion without input.!rhineCall a " every time the input is 'Just a'.[Caution: This will not change the time differences since the last tick. For example, while  integrate 1 is approximately the same as timeInfoOf sinceInit, mapMaybe $ integrate 1 is very different from mapMaybe $ timeInfoOf sinceInit/. The former only integrates when the input is Just 1J, whereas the latter always returns the correct time since initialisation.€  !",-./0123456789:;<=>?@ABCDEFGHIJKLcrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨ !€ !  !",-./0123456789:;<=>?@ABCDEFGHIJKLcrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨None&'SXž"rhineAn "" is a side-effectful asynchronous signal networkd, where input, data processing (including side effects) and output need not happen at the same time.The type parameters are:m-: The monad in which side effects take place.clp: The clock of the whole signal network. It may be sequentially or parallely composed from other clocks.a,: The input type. Input arrives at the rate In cl.b.: The output type. Output arrives at the rate Out cl.#rhineRA synchronous monadic stream function is the basic building block. For such an "H, data enters and leaves the system at the same rate as it is processed.$rhineTwo "6s may be sequentially composed if there is a matching Ú between them.%rhineTwo "@s with the same input and output data may be parallely composed."%$#"%$#None"#$&'8 &rhineA signal network (") enclosed by matching Ú_s and further auxiliary data, such that it can be stepped with each arriving tick from a clock cl . They play a similar role like  ReactHandle s in dunai.The type parameters: m: The monad in which the " and the Ús produce side effectscla+: The (irrelevant) input clock of the left Úclb: The clock at which the left Ú produces outputcl: The clock at which the " ticksclc: The clock at which the right Ú accepts inputcld-: The (irrelevant) output clock of the right Úa*: The (irrelevant) input type of the left Úb: The input type of the "c: The output type of the "d,: The (irrelevant) output type of the right Ú(rhine.The left buffer from which the input is taken.)rhine.The signal network that will process the data.*rhine/The right buffer in which the output is stored.+rhine*The leftmost clock of the signal network, cl8, may be a parallel subclock of the buffer clock. +B specifies in which position 'In cl' is a parallel subclock of clb.,rhineThe same on the output side.-rhineGThe last times when the different parts of the signal tree have ticked..rhine.The time when the whole clock was initialised./rhine'Initialise the tree of last tick times.0rhine Initialise a &Y from a signal network, two matching enclosing resampling buffers and an initial time.1rhineSIn this function, one tick, or step of an asynchronous signal network happens. The •c holds the information which part of the signal tree will tick. This information is encoded in the  of the •3, which is of type 'Either tag1 tag2' in case of a ¾ or a ¸?, encoding either a tick for the left clock or the right clock.2rhineA ÚZ producing only units. (Slightly more efficient and direct implementation than the one in (X that additionally unifies the clock types in a way needed for the tick implementation.)1rhineTimestamp of the present tickrhineR of the overall clock; contains the information which subsystem will become active &',+*)(.-/012 &',+*)(.-/012None"#HV@þ3rhineAn L{ can be given arbitrary other arguments that cause it to tick without doing anything and replicating the last output.4rhine Upsample a # to a parallel clock. The given  is only called when clRF ticks, otherwise the last output is replicated (with the given b as initialisation).5rhine Upsample a # to a parallel clock. The given  is only called when clLF ticks, otherwise the last output is replicated (with the given b as initialisation).345345NoneHPSVXGä6rhine Commute two ²# transformer layers past each other7rhineCreate ("wrap") a ²< layer in the monad stack of a behaviour. Each tick, the ²I side effect is performed by passing the original behaviour the extra r input.8rhineRemove ("run") a ²O layer from the monad stack by making it an explicit input to the behaviour.9rhine Remove a ²6 layer by passing the readonly environment explicitly.67896789NoneHSVXRa:rhine>Generates random values, updating the generator on every step.;rhine<Updates the generator every step but discards the generator.<rhineZUpdates the generator every step but discards the value, only outputting the generator.=rhineFEvaluates the random computation by using the global random generator.>rhineXEvaluates the random computation by using the global random generator on the first tick.?rhine%Produce a random value at every tick.@rhineGProduce a random value at every tick, within a range given per tick.ArhineCProduce a random value at every tick, within a range given once.:rhineThe initial random seed )*+:;<=>?@A :;<=>?@A)*+NoneHSVXk^Brhine(Compatibility to U.S. american spelling.CrhineA clock polymorphic DN, or equivalently an exception-throwing behaviour. Any clock with time domain time may occur.DrhineCA synchronous exception-throwing signal function. It is based on a newtype from Dunai, À, to exhibit a monad interface in the exception type. Á then corresponds to throwing an exception, and `(>>=)` is exception handling. (For more information, see the documentation of À.)m>: The monad that the signal function may take side effects incl.: The clock on which the signal function ticksa: The input typeb: The output typee,: The type of exceptions that can be thrownErhine)Immediately throw the incoming exception.Frhine&Immediately throw the given exception.GrhineDo not throw an exception.Hrhine#Throw the given exception when the  turns true.Irhine Variant of H*, where the exception can vary every tick.JrhineThrow the exception e$ whenever the function evaluates to Ã.Krhine Variant of J? for Kleisli arrows. | Throws the exception when the input is Ã.LrhineWhen the input is Just e, throw the exception e.Mrhine$Leave the monad context, to use the D as an .Nrhine0Enter the monad context in the exception for  s in the X monad. The . will be run until it encounters an exception.OrhinecWithin the same tick, perform a monadic action, and immediately throw the value as an exception.Prhine A variant of O without input.QrhineUAdvances a single tick with the given Kleisli arrow, and then throws an exception.%#$%&'(MNOPQRSTUVXWdefBCDEFGHIJKLMNOPQBCDEFGHIJKLMNOPQ#$(&'%None "#>HSVX¬!Rrhine(Read the environment variable, i.e. the •.Srhine*Utility to apply functions to the current •, such as record selectors: ` printAbsoluteTime :: ClSF IO cl () () printAbsoluteTime = timeInfoOf absolute >>> arrMCl print Trhine<Continuously return the time difference since the last tick.UrhineCContinuously return the time difference since clock initialisation.Vrhine&Continuously return the absolute time.Wrhine0Continuously return the tag of the current tick.Xrhine%Calculate the time passed since this - was instantiated. This is _not_ the same as U5, which measures the time since clock initialisation.3For example, the following gives a sawtooth signal: Nsawtooth = safely $ do try $ sinceStart >>> proc time -> do throwOn () - time* 1 returnA -< time safe sawtooth If you replace X by U^, it will usually hang after one second, since it doesn't reset after restarting the sawtooth.Yrhine Alias for )*k (sequential composition) with higher operator precedence, designed to work with the other operators, e.g.: ;clsf1 >-> clsf2 @@ clA ||@ sched @|| clsf3 >-> clsf4 @@ clB&The type signature specialises e.g. to C(>->) :: Monad m => ClSF m cl a b -> ClSF m cl b c -> ClSF m cl a cZrhine Alias for )+.[rhineAOutput a constant value. Specialises e.g. to this type signature: %arr_ :: Monad m => b -> ClSF m cl a b\rhine)The identity synchronous stream function.]rhineThe output of integralFrom v0F is the numerical Euler integral of the input, with initial offset v0.^rhine,Euler integration, with zero initial offset._rhineThe output of derivativeFrom v0r is the numerical derivative of the input, with a Newton difference quotient. The input is initialised with v0.`rhine4Numerical derivative with input initialised to zero.arhineLike _a, but uses three samples to compute the derivative. Consequently, it is delayed by one sample.brhineLike a2, but with the initial position initialised to a.crhineÿZA weighted moving average signal function. The output is the average of the first input, weighted by the second input (which is assumed to be always between 0 and 1). The weight is applied to the average of the last tick, so a weight of 1 simply repeats the past value unchanged, whereas a weight of 0 outputs the current value.drhine{An exponential moving average, or low pass. It will average out, or filter, all features below a given time constant t5. (Equivalently, it filters out frequencies above 1 / (2 * pi * t).)erhine-An average, or low pass, initialised to zero.frhineA linearised version of d. It is more efficient, but only accurate if the supplied time scale is much bigger than the average time difference between two ticks.grhineLinearised version of e.hrhine Alias for e.irhineFilters out frequencies below 1 / (2 * pi * t).jrhine#Filters out frequencies other than 1 / (2 * pi * t).krhineFilters out the frequency 1 / (2 * pi * t).lrhineCRemembers and indefinitely outputs ("holds") the first input value.mrhinedRemembers all input values that arrived within a given time window. New values are appended left.nrhineJDelay a signal by certain time span, initialising with the first input.orhineaThrows an exception after the specified time difference, outputting the time passed since the o was instantiated.prhineLike p/, but doesn't output the remaining time at all.qrhineLike o3, but divides the remaining time by the total time.rrhineRemembers the last Ä8 value, defaulting to the given initialisation value. arhineThe initial positioncrhineThe initial positiondrhineThe initial positionrhine.The time scale on which the signal is averagederhine.The time scale on which the signal is averagedfrhineThe initial positionrhine.The time scale on which the signal is averagedgrhine.The time scale on which the signal is averagedirhineThe time constant tjrhineThe time constant tkrhineThe time constant tmrhineThe size of the time windownrhine!The time span to delay the signal!RSTUVWXYZ[\]^_`abcdefghijklmnopqr!RSTUVWXYZ[\]^_`abcdefghijklmnopqrY6Z6,None­åÕ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVXWcdefrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨ !6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrNoneSX·QsrhinePostcompose a Ú with a matching .trhine Precompose a Ú with a matching .urhineParallely compose two Ús.vrhineParallely compose two Ús, duplicating the input.wrhineGiven a Úž where the output type depends on the input type polymorphically, we can produce a timestamped version that simply annotates every input value with the • when it arrived.stuvwstuvws2t1u4v4None&'¬xrhine2Postcompose a signal network with a pure function.yrhine1Precompose a signal network with a pure function.zrhineRCompose two signal networks on the same clock in data-parallel. At one tick of cl, both networks are stepped.{rhineUCompose two signal networks on different clocks in clock-parallel. At one tick of ParClock m cl1 cl2U, one of the networks is stepped, dependent on which constituent clock has ticked..Note: This is essentially an infix synonym of %|rhineUCompose two signal networks on different clocks in clock-parallel. At one tick of ParClock m cl1 cl2U, one of the networks is stepped, dependent on which constituent clock has ticked.xyz{|xyz{|None &'.=?@AHUVÉN}rhine(A singleton clock that counts the ticks.~rhineVA pure (side effect free) clock with fixed step size, i.e. ticking at multiples of ni. The tick rate is in the type signature, which prevents composition of signals at different rates.€rhine4Extract the type-level natural number as an integer.rhineTwo ~5 clocks can always be scheduled without side effects.}~€‚~€}‚ None .@AHUVÓ„rhineA clock ticking every n# milliseconds, in real time. Since nN is in the type signature, it is ensured that when composing two signals on a „- clock, they will be driven at the same rate.The tag of this clock is Â, where Ã% represents successful realtime, and Å a lag.†rhine·This implementation measures the time after each tick, and waits for the remaining time until the next tick. If the next tick should already have occurred, the tag is set to Å*, representing a failed real time attempt.ˆrhineTwo „2 clocks can always be scheduled deterministically.„…†‡ˆ„…†‡ˆ!None"#>HVãYŠrhineQA simple linear interpolation based on the last calculated position and velocity.‹rhine7sinc-Interpolation, or Whittaker-Shannon-Interpolation.FThe incoming signal is strictly bandlimited by the frequency at which cl1Y ticks. Each incoming value is hulled in a sinc function, these are added and sampled at cl2²'s ticks. In order not to produce a space leak, the buffer only remembers the past values within a given window, which should be chosen much larger than the average time between cl1 's ticks.Œrhine7Interpolates the signal with Hermite splines, using b.oCaution: In order to calculate the derivatives of the incoming signal, it has to be delayed by two ticks of cl1R. In a non-realtime situation, a higher quality is achieved if the ticks of cl2 are delayed by two ticks of cl1.Šrhine/The initial velocity (derivative of the signal)rhineThe initial position‹rhine^The size of the interpolation window (for how long in the past to remember incoming values)Š‹ŒŠ‹ŒNone .=>?@AHSVX $ rhineA clock that ticks whenever an event€ is emitted. It is not yet bound to a specific channel, since ideally, the correct channel is created automatically by ‘Q. If you want to create the channel manually and bind the clock to it, use ™.rhine:A monad transformer in which events can be emitted onto a Æ.rhine Escape the i layer by explicitly providing a channel over which events are sent. Often this is not needed, and ‘ can be used instead.‘rhineuCreate a channel across which events can be communicated, and subsequently execute all event effects on this channel.)Ideally, this action is run _outside_ of flow, e.g. runEventChanT $ flow myRhine+. This way, exactly one channel is created.Caution: Don't use this with BF, since it would create a new channel every tick. Instead, create one chan :: Chan c , e.g. with , and then use ’.’rhineRemove ("run") an \ layer from the monad stack by passing it explicitly the channel over which events are sent.-This is usually only needed if you can't use ‘, to create the channel. Typically, create a chan :: Chan c1 in your main program before the main loop (e.g. flowU) would be run, then, by using this function, pass the channel to every behaviour or * that wants to emit events, and, by using ™/, to every clock that should tick on the event.“rhine'Emit a single event. This causes every ' on the same monad to tick immediately.=Be cautious when emitting events from a signal clocked by an q. Nothing prevents you from emitting more events than are handled, causing the event buffer to grow indefinitely.”rhineEmit an event on every tick.•rhine*Emit an event whenever the input value is  Just event.–rhineLike “8, but completely evaluates the event before emitting it.—rhineLike ”8, but completely evaluates the event before emitting it.˜rhineLike •8, but completely evaluates the event before emitting it.™rhinesCreate an event clock that is bound to a specific event channel. This is usually only useful if you can't apply ‘ to the main loop (see ’).šrhineGiven two clocks with an  layer directly atop the ÇX monad, you can schedule them using concurrent GHC threads, and share the event channel.Typical use cases:=Different subevent selection clocks (implemented i.e. with -)) on top of the same main event source.5An event clock and other event-unaware clocks in the Ç! monad, which are lifted using §.Ž‘’“”•–—˜™šŽ‘’“”•–—˜™š"None§rhineA  consists of a "( together with a clock of matching type cla. It is a reactive program, possibly with open inputs and outputs. If the input and output types a and b are both '()', that is, the Y is "closed", then it is a standalone reactive program that can be run with the function flow.ž Ÿž Ÿ#None>EHVX-• ¡rhinewA purely syntactical convenience construction allowing for ternary syntax for parallel composition, described below.£rhinezA purely syntactical convenience construction enabling quadruple syntax for sequential composition, as described below.¥rhineeA point at which sequential asynchronous composition ("resampling") of signal networks can happen.§rhineCreate a synchronous z by combining a clocked signal function with a matching clock. Synchronicity is ensured by requiring that data enters (In cl) and leaves (Out cl-) the system at the same as it is processed (cl).¨rhineSyntactic sugar for ¥.©rhineSyntactic sugar for £.ªrhineJThe combinators for sequential composition allow for the following syntax: ÿbrh1 :: Rhine m cl1 a b rh1 = ... rh2 :: Rhine m cl2 c d rh2 = ... rb :: ResamplingBuffer m (Out cl1) (In cl2) b c rb = ... sched :: Schedule m cl1 cl2 sched = ... rh :: Rhine m (SequentialClock m cl1 cl2) a d rh = rh1 >-- rb -@- sched --> rh2 «rhineSyntactic sugar for ¡.¬rhineHThe combinators for parallel composition allow for the following syntax: ÿ!rh1 :: Rhine m clL a b rh1 = ... rh2 :: Rhine m clR a c rh2 = ... sched :: Schedule m clL clR sched = ... rh :: Rhine m (ParallelClock clL clR) a (Either b c) rh = rh1 ++@ sched @++ rh2 ­rhineFurther syntactic sugar for ¡.®rhineHThe combinators for parallel composition allow for the following syntax: ÿrh1 :: Rhine m clL a b rh1 = ... rh2 :: Rhine m clR a b rh2 = ... sched :: Schedule m clL clR sched = ... rh :: Rhine m (ParallelClock clL clR) a b rh = rh1 ||@ sched @|| rh2 ¡¢£¤¥¦§¨©ª«¬­®§¥¦¨£¤©ª¡¢«¬­®§5¨8©2ª1«4¬3­4®3$None"#&'9¯rhineTakes a closed \ (with trivial input and output), and runs it indefinitely. This is typically the main loop.cAll input has to be created, and all output has to be consumed by means of side effects in a monad m.Basic usage (synchronous case): ÿDsensor :: ClSF MyMonad MyClock () a sensor = constMCl produceData processing :: ClSF MyMonad MyClock a b processing = ... actuator :: ClSF MyMonad MyClock b () actuator = arrMCl consumeData mainSF :: ClSF MyMonad MyClock () () mainSF = sensor >-> processing >-> actuator main :: MyMonad () main = flow $ mainSF @@ clock °rhineRun a synchronous C with its clock as a main loop, similar to Yampa's, or Dunai's, H.¯°¯°None9Óÿ{  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVXWba`_^]\[ZYcdefpqrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÔÕÖרÙÚÛÝÜÞßàáâãäåæçèéêëìíîïðñòôóõö÷ùúýþ  !"#$%6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚„…†‡ˆŠ‹ŒŽ‘’“”•–—˜™šžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°ÿ{  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVXWba`_^]\[ZYcdefpqrstuvw€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–š—˜™›œžŸ ¡¢£¤¥¦§¨­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÔÕÖרÙÚÛÝÜÞßàáâãäåæçèéêëìíîïðñòôóõö÷ùúýþ  !"#$%6789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚„…†‡ˆŠ‹ŒŽ‘’“”•–—˜™šžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°È./0./1./2./3./4.56.57.89./:./;./<./=./>./?./@./A./B./C./D./E./E./F./G./H./I./J./K./L./M./N./O./O./P.)*.)+QRSQRTQRUQRVQRWQRXQYZQY[QY\Q]^Q]_Q]`Q]aQ]bQ]cQ]dQ]eQ]fQ]gQ]hQ]iQ]jQ]kQ]lQ]mQ]nQ]oQ]pQ]qQ]rQ]sQtuQtvQtwQtxQtyQtzQ{|Q{}Q{~Q{Q{€‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚ŽŽ‘Ž’Ž“Ž”Ž•Ž–Ž—Ž˜Ž™š›œ‚‚ž‚Ÿ ¡¡¢£¤¥¦§'¨'©ªª«¬­®¯°±²³´µ¶·¸¸¹º»»¼½¾¾¿ÀÁÁÂÃÄÅÆÇÈÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêêëìíîïïðñòóóôõö÷øùúûüýþÿ                   !"#$%%&'(()*++,,-./01234567789:;<=>?@ABCDEFGHIJKLMMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢££¤¥¦§ ¨ ¨ © ª « ¬!­!®!¯°°±²³´µ¶·¸¹º»¼½¾"¿"¿"À"Á#Â#Â#Ã#Ã#Ä#Ä#Å#Æ#Ç#È#É#Ê#Ë#Ì$Í$Î%ÏÐÑ%Ò&ÓÔÕÖ.ר.ÙÚ.ÛÜ.ÝÞ.Ûßàáâã.äå.æçèQRé.Ýêàáëàáì.Ûíàáî.8ïàáðñ"rhine-0.6.0-G6QBLs4firv74OgBdD2WjtFRP.Rhine.Clock FRP.RhineFRP.Rhine.Clock.Realtime.EventFRP.Rhine.ClSF.ExceptFRP.Rhine.ClSF.RandomFRP.Rhine.TimeDomainControl.Monad.ScheduleFRP.Rhine.ScheduleFRP.Rhine.Schedule.TransFRP.Rhine.Schedule.ConcurrentlyFRP.Rhine.ResamplingBuffer#FRP.Rhine.ResamplingBuffer.TimelessFRP.Rhine.ResamplingBuffer.MSFFRP.Rhine.ResamplingBuffer.LIFO#FRP.Rhine.ResamplingBuffer.KeepLastFRP.Rhine.ResamplingBuffer.FIFO"FRP.Rhine.ResamplingBuffer.CollectFRP.Rhine.Clock.SelectFRP.Rhine.Clock.Realtime.StdinFRP.Rhine.Clock.Realtime.BusyFRP.Rhine.Clock.Realtime.AudioFRP.Rhine.Clock.PeriodicFRP.Rhine.ClSF.Core FRP.Rhine.SNFRP.Rhine.Reactimation.TickFRP.Rhine.ClSF.UpsampleFRP.Rhine.ClSF.ReaderFRP.Rhine.ClSF.UtilFRP.Rhine.ResamplingBuffer.UtilFRP.Rhine.SN.CombinatorsFRP.Rhine.Clock.FixedStep$FRP.Rhine.Clock.Realtime.Millisecond(FRP.Rhine.ResamplingBuffer.InterpolationFRP.Rhine.Type"FRP.Rhine.Reactimation.CombinatorsFRP.Rhine.ReactimationFRP.Rhine.ClSF.Except.UtilFRP.Rhine.ClSF.Random.UtilFRP.Rhine.Schedule.UtilTimelessControl.Category>>><<<FRP.Rhine.ClSFSelectbase Control.Arrowarrfirstapp|||loopControl.Monad.IO.ClassliftIOMonadIOControl.Concurrent.ChannewChanleftApp^<<<<^>>^^>>returnA&&&***secondArrow runKleisliKleisli zeroArrow ArrowZero<+> ArrowPlus+++rightleft ArrowChoice ArrowApply ArrowMonad ArrowLoop!dunai-0.6.0-8qvD2s1FVwsVR2qW4ik4eControl.Monad.Trans.MSF.Exceptsafesafely currentInputexceptS runMSFExceptEmptyControl.Monad.Trans.MSF.Random getRandomsRS_ getRandomsRS getRandomsSData.MonadicStreamFunction.UtilpauseOn traceWhen traceWithtrace repeatedlyunfoldmealyaccumulateWith mappendFrommappendSsumFromsumScountfifonextiPostiPrewithSideEffect_withSideEffect mapMaybeSMStreamMSinkData.MonadicStreamFunction.CoremorphS liftTransS liftBaseS liftBaseMarrMconstM'Data.MonadicStreamFunction.InternalCore reactimateembedfeedbackmorphGSMSFtransformers-0.5.5.0Control.Monad.Trans.ExceptexceptthrowEcatchE withExceptT mapExceptT runExceptT withExcept mapExcept runExceptExceptExceptT.simple-affine-space-0.1-8cePZS7FOscA9HBWNQ3R69Data.VectorSpace normalizenormdot negateVector^-^^+^^/*^ zeroVector VectorSpace time-1.8.0.2 Data.Time.Clock.Internal.UTCTimeUTCTimeliftPass liftListen liftCallCC ScheduleTWaitwait runScheduleT runScheduleIOraceasync $fFunctorWaitduplicateSubtick swapEither NumTimeDomainfromNumTimeDomain TimeDomainDiffdiffTime$fTimeDomain()$fTimeDomainInteger$fTimeDomainFloat$fTimeDomainDouble$fTimeDomainUTCTime$fTimeDomainNumTimeDomain$fNumNumTimeDomainIOClock LiftClock HoistClockunhoistedClock monadMorphismRescaledClockSunscaledClockSrescaleSRescaledClockMunscaledClockMrescaleM RescaledClock unscaledClockrescaleRescalingSInit RescalingS RescalingM RescalingTimeInfo sinceLast sinceInitabsolutetagClockTimeTag initClockRunningClockInit RunningClockretag genTimeInforescaleMToSInitrescaledClockToMrescaledClockMToSrescaledClockToS liftClockioClock$fClockmRescaledClock$fClockmRescaledClockM$fClockmRescaledClockS$fClockm2HoistClockParClockInclusion ParClockInL ParClockInR ParClockReflLastTimeSequentialLastTimeParallelLastTime LeafLastTimeOutInParClock ParallelClock parallelCl1 parallelCl2parallelScheduleSeqClockSequentialClock sequentialCl1 sequentialCl2sequentialScheduleSchedule initSchedule hoistSchedule flipSchedulerescaledSchedulerescaledScheduleSreaderSchedule schedSeq1 schedSeq2 schedPar1 schedPar1' schedPar2 schedPar2'parClockTagInclusion$fClockmSequentialClock$fClockmParallelClockschedule concurrentlyconcurrentlyWriterconcurrentlyExceptconcurrentlyMaybeResBufResamplingBufferputgethoistResamplingBuffer AsyncMealyamPutamGettimelessResamplingBuffertrivialResamplingBuffer msfBuffer lifoUnbounded lifoBounded lifoWatchkeepLast fifoUnbounded fifoBounded fifoWatchcollectcollectSequence pureBuffer foldBuffer SelectClock mainClockselectschedSelectClocksschedSelectClockAndMainfilterS$fClockmSelectClock StdinClock$fSemigroupStdinClock$fClockmStdinClockBusy $fClockIOBusyPureAudioClockFPureAudioClock AudioClock AudioRateHz44100Hz48000Hz96000pureAudioClockF$fClockmAudioClock$fAudioClockRateHz96000$fAudioClockRateHz48000$fAudioClockRateHz44100$fClockmPureAudioClockPeriodic$fNonemptyNatList:$fNonemptyNatList:0$fClockFreeTPeriodic BehaviorF BehaviourFBehavior BehaviourClSignalClSF hoistClSFhoistClSFAndClockliftClSFliftClSFAndClocktimelessarrMClconstMClmapMaybeSN Synchronous SequentialParallelTickablebuffer1ticksnbuffer2 parClockIn parClockOutlastTimeinitTime initLastTimecreateTickabletick upsampleMSF upsampleR upsampleLcommuteReadersreaderS runReaderS runReaderS_runRandS evalRandS execRandS evalRandIOS evalRandIOS' getRandomS getRandomRS getRandomRS_BehaviorFExceptBehaviourFExcept ClSFExceptthrowSthrowpassthrowOnthrowOn' throwOnCond throwOnCondM throwMaybe runClSFExcepttryonceonce_steptimeInfo timeInfoOf sinceLastS sinceInitS absoluteStagS sinceStart>-><-<arr_clId integralFromintegralderivativeFrom derivativethreePointDerivativeFromthreePointDerivativeweightedAverageFrom averageFromaverageaverageLinFrom averageLinlowPasshighPassbandPassbandStop keepFirst historySincedelayBytimertimer_ scaledTimerlastS>>-^^->>*-*&-& timestamped>>>^^>>>****||||++++Count FixedStepstepsizescheduleFixedStepdownsampleFixedStep$fClockmFixedStep Millisecond waitClockdownsampleMillisecondscheduleMillisecond$fClockIOMillisecondlinearsinccubic EventClock EventChanTwithChan runEventChanT withChanSemitemitS emitSMaybeemit'emitS' emitSMaybe' eventClockOnconcurrentlyWithEvents$fClockReaderTEventClock$fSemigroupEventClockRhinesnclockRhineParallelAndScheduleRhineAndResamplingPointResamplingPoint@@-@->---->++@@++||@@||flow reactimateClcommuteExceptReaderControl.Monad.Trans.ReaderReaderTcommuteReaderExceptcommuteReaderRand*MonadRandom-0.5.1.2-LYdqLIp5tmA71fJ1sa9zEvControl.Monad.Trans.Random.LazyRandTGHC.NumNum Data.EitherEither GHC.MaybeNothingGHC.Base SemigroupMaybeghc-prim GHC.TypesFloatrateToIntegralGHC.RealIntegral GHC.Float double2FloatcycleS MSFExceptreturnBoolTrueJustFalseChanIO