úÎ`\z-      !"#$%&'()*+,%5The possible structures of a node are defined by the  type. Note that the SNLx# nodes are only needed to optimise 4applicatives, they can all be expressed in terms of SNK and SNA. SNL5 f: liftA5 f SNL4 f: liftA4 f SNL3 f: liftA3 f SNL2 f: liftA2 f SNL1 f: fmap f SNR r*: opaque reference to connect peripherals  SNE s e ss: latcher that starts out as s and becomes the  current value of ss at every moment when e is true  SNA sf sx!: pointwise function application  SNT s x t1: stateful transfer function, which also depends  on an input signal s SNS x t: stateful generator, where x is current state and  t is the update function SNK x : constantly x ?A node can have four states that distinguish various stages of sampling and aging. Aged x s% is an already sampled signal, where x is the  current value and s* is the new version of the signal for the  next superstep Sample x is just the value x, eventually to be replaced 1 by the aged version of its corresponding signal  Sampling s is still s after its current value was $ requested, but still not delivered Ready s is simply the signal s that was not sampled yet A signal is represented as a  transactional structural node. BSinks are used when feeding input into peripheral-bound signals. %Time is continuous. Nothing fancy. BYou can uncomment the verbose version of this function to see the &applicative optimisations in action. BThis function is really just a shorthand to create a reference to a given node. BSampling and aging the signal and all of its dependencies, at the same time. We don'1t need the aged signal in the current superstep, Eonly the current value, so we sample before propagating the changes, :which might require the fresh sample because of recursive definitions. 1Finalising the aged signals for the next round. ?Aging the signal. Stateful signals have their state forced to Bprevent building up big thunks, and the latcher also does its job 1here. The other nodes are structurally static. ASampling the signal at the current moment. This is where static Enodes propagate changes to those they depend on. Transfer functions ( ) and latchers (*) work without delay, i.e. the effects of <their input signals can be observed in the same superstep. @Sampling the signal with some kind of delay in order to resolve Cdependency loops. Transfer functions simply return their previous @output, while latchers postpone the change and pass through the Gcurrent value of their current signal even if the latch control signal Eis true at the moment. Other types of signals are always handled by the ; function, so it is not possible to create a stateful loop +composed of solely stateless combinators. @Advancing the whole network that the given signal depends on by 2the amount of time given in the second argument. the top-level signal the amount of time to advance  the current value of the signal AA pure stateful signal. The initial state is the first output. initial state state transformation =A stateful transfer function. The current input affects the Fcurrent output, i.e. the initial state given in the first argument is Gconsidered to appear before the first output, and can only be directly observed by the  function. initial internal state state updater function  input signal #Reactive signal that starts out as s and can change its !behaviour to the one supplied in ss whenever e is true. The change =can be observed immediately, unless the signal is sampled by 6, which puts a delay on the latch control (but not on the latched signal!). s: initial behaviour e: latch control signal ss(: signal of potential future behaviours !<A signal that can be directly fed through the sink function >returned. This can be used to attach the network to the outer world. initial value )the signal and an IO function to feed it -GThe equality test checks whether two signals are physically the same. .The Show* instance is only defined for the sake of /... 0The 1+ instance with run-time optimisation. The 2 Goperator tries to move all the pure parts to its left side in order to Hflatten the structure, hence cutting down on book-keeping costs. Since Dapplicatives are used with pure functions and lifted values most of 6the time, one can gain a lot by merging these nodes. "  !"   !"    !3456789:;<=>?@ABCDE"ETraversing the network starting from the given signal and converting 2it into a string containing the graph in Graphviz ( http://www.graphviz.org/+) dot format. Stateful nodes are coloured according to their type. ABecause of the fact that Elerea primitives are not referentially @transparent, the results might differ depending on whether this Cfunction is called before or after sampling (this also affects the ?actual network!), but the networks should be still equivalent. """ #The #8 transfer function emits the value of a signal from the Fprevious superstep, starting with the filler value given in the first  argument. $The $9 transfer function takes a bool signal and emits another Fbool signal that turns true only at the moment when there is a rising edge on the input. %%Point-wise equality of two signals. &'Point-wise inequality of two signals. ''Point-wise comparison of two signals. ('Point-wise comparison of two signals. )'Point-wise comparison of two signals. *'Point-wise comparison of two signals. +'Point-wise OR of two boolean signals. ,(Point-wise AND of two boolean signals.  !#$%&'()*+, !#$%&'()*,+ #$%&'()*+,F      !"#$%&'()*+,-./0123456378379:;<=>?@ABCDEFGHIJKLM elerea-0.3.0FRP.Elerea.InternalFRP.Elerea.Graph FRP.Elerea SignalNodeSNL5SNL4SNL3SNL2SNL1SNRSNESNASNTSNSSNK SignalTransAgedSampleSamplingReadySignalSSinkDTimeTimedebugLog createSignal signalValuecommitadvancesample sampleDelayed superstepstatefultransferlatcherexternal signalToDotdelayedge==@/=@<@<=@>=@>@||@&&@ $fEqSignal $fShowSignalbaseGHC.NumNum$fApplicativeSignalControl.Applicative Applicative<*> SignalInfoNoneLift5Lift4Lift3Lift2Lift1ExternalLatcherAppTransferStatefulConst SignalStoreIdgetPtr buildStore insertSignal nodeLabel