Îõ³h&.‚,}Ü      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[(c) 2011 Brent YorgeyBSD-style (see LICENSE)byorgey@cis.upenn.edu Safe-Inferred(8ÁÂÃÄÅÌÑÙÚÜ, 3activeThere are two types of Active values:An  can simply be a >, that is, a time-varying value with start and end times.An æ value can also be a constant: a single value, constant across time, with no start and end times.'The addition of constant values enable \ and ] instances for .activeA  Dynamic a can be thought of as an a7 value that changes over the course of a particular . It's envisioned that DynamicÁ will be mostly an internal implementation detail and that Û will be most commonly used. But you never know what uses people might find for things.activeAn Eraä is a concrete span of time, that is, a pair of times representing the start and end of the era. Era.s form a semigroup: the combination of two Eras is the smallest Era- which contains both. They do not form a \, since there is no EraÈ which acts as the identity with respect to this combining operation.Era is abstract. To construct Era values, use  ; to deconstruct, use   and .activeAn abstract type representing  elapsed timeï between two points in time. Note that durations can be negative. Literal numeric values may be used as Durations thanks to the ^ and _ instances.active"An abstract type for representing points in time6. Note that literal numeric values may be used as Times, thanks to the the ^ and _ instances.activeÅA convenient wrapper function to convert a numeric value into a time. activeÄA convenient unwrapper function to turn a time into a numeric value. activeÉA convenient wrapper function to convert a numeric value into a duration. activeÈA convenient unwrapper function to turn a duration into a numeric value. active Create an  by specifying start and end s. activeGet the start  of an .active Get the end  of an .active Compute the  of an .active Create a = from a start time, an end time, and a time-varying value.active Fold for .activeShift a  value by a certain duration.active Create an  value from a .activeCreate a dynamic = from a start time, an end time, and a time-varying value.active Fold for €s. Process an 'Active a', given a function to apply if it is a pure (constant) value, and a function to apply if it is a .active Modify an É value using a case analysis to see whether it is constant or dynamic.active Interpret an  value as a function from time.activeGet the value of an Active a at the beginning of its era.activeGet the value of an Active a at the end of its era.activeGet the  of an  value (or `$ if it is a constant/pure value).activeTest whether an  value is constant.activeTest whether an  value is .activeui represents the  unit interval, which takes on the value t at time t, and has as its era [0,1]. It is equivalent to  0 1#, and can be visualized as follows: :diagrams/src_Data_Active_uiDia.svg#diagram=uiDia&width=200*On the x-axis is time, and the value that uiâ takes on is on the y-axis. The shaded portion represents the era. Note that the value of ui¼ (as with any active) is still defined outside its era, and this can make a difference when it is combined with other active values with different eras. Applying a function with að affects all values, both inside and outside the era. To manipulate values outside the era specifically, see % and (. To alter the values that ui/ takes on without altering its era, use its b and ] instances. For example,  (*2) <$> ui varies from 0 to 2 over the era [0,1]$. To alter the era, you can use  or ".active interval a b% is an active value starting at time a, ending at time b, and taking the value t at time t.active stretch s act "stretches" the active act so that it takes s/ times as long (retaining the same start time). active stretchTo d es an  so it has duration d. Has no effect if (1) d is non-positive, or (2) the " value is constant, or (3) the Ý value has zero duration. [AJG: conditions (1) and (3) no longer true: to consider changing]!activea1 `during` a2 es and "s a1# so that it has the same era as a2. Has no effect if either of a1 or a2 are constant."active shift d act shifts the start time of act by duration d&. Has no effect on constant values.#activeèReverse an active value so the start of its era gets mapped to the end and vice versa. For example,  backwards  can be visualized as Èdiagrams/src_Data_Active_backwardsDia.svg#diagram=backwardsDia&width=200$activeÜTake a "snapshot" of an active value at a particular time, resulting in a constant value.%activeÝ"Clamp" an active value so that it is constant before and after its era. Before the era, clamp a takes on the value of a7 at the start of the era. Likewise, after the era, clamp a takes on the value of a at the end of the era. clamp% has no effect on constant values. For example, clamp  can be visualized as Àdiagrams/src_Data_Active_clampDia.svg#diagram=clampDia&width=200 See also & and '<, which clamp only before or after the era, respectively.&activeÜ"Clamp" an active value so that it is constant before the start of its era. For example,  clampBefore  can be visualized as Ìdiagrams/src_Data_Active_clampBeforeDia.svg#diagram=clampBeforeDia&width=200See the documentation of % for more information.'activeÚ"Clamp" an active value so that it is constant after the end of its era. For example,  clampBefore  can be visualized as Êdiagrams/src_Data_Active_clampAfterDia.svg#diagram=clampAfterDia&width=200See the documentation of % for more information.(active?"Trim" an active value so that it is empty outside its era. trim" has no effect on constant values. For example, trim  can be visualized as >diagrams/src_Data_Active_trimDia.svg#diagram=trimDia&width=200 Actually, trim ui7 is not well-typed, since it is not guaranteed that uiÿ's values will be monoidal (and usually they won't be)! But the above image still provides a good intuitive idea of what trimÄ is doing. To make this precise we could consider something like trim (First . Just  $ ui). See also ) and  trimActive;, which trim only before or after the era, respectively.)active+"Trim" an active value so that it is empty before' the start of its era. For example,  trimBefore  can be visualized as Êdiagrams/src_Data_Active_trimBeforeDia.svg#diagram=trimBeforeDia&width=200See the documentation of ( for more details.*active+"Trim" an active value so that it is empty after& the end of its era. For example,  trimAfter  can be visualized as Èdiagrams/src_Data_Active_trimAfterDia.svg#diagram=trimAfterDia&width=200See the documentation of ( for more details.+activeSet the era of an 2 value. Note that this will change a constant É into a dynamic one which happens to have the same value at all times.,active atTime t a. is an active value with the same behavior as a', shifted so that it starts at time t. If a) is constant it is returned unchanged.-active a1 `after` a2& produces an active that behaves like a1/ but is shifted to start at the end time of a2 . If either a1 or a2 are constant, a1 is returned unchanged..activeSequence/overlay two É values: shift the second to start immediately after the first (using -), then compose them (using c)./active "Splice" two Ò values together: shift the second to start immediately after the first (using -§), and produce the value which acts like the first up to the common end/start point, then like the second after that. If both are constant, return the first.0active.Splice together a list of active values using / . The list must be nonempty.1active Create an ActiveÈ which takes on each value in the given list in turn during the time [0,1]Ç, with each value getting an equal amount of time. In other words, discrete¡ creates a "slide show" that starts at time 0 and ends at time 1. The first element is used prior to time 0, and the last element is used after time 1.It is an error to call discrete on the empty list.2activesimulate r act simulates the  value act˜, returning a list of "snapshots" taken at regular intervals from the start time to the end time. The interval used is determined by the rate rÔ, which denotes the "frame rate", that is, the number of snapshots per unit time.If the ý value is constant (and thus has no start or end times), a list of length 1 is returned, containing the constant value.<active a is a d whenever aà is: the eras are combined according to their semigroup structure, and the values of type a$ are combined pointwise. Note that  a cannot be an instance of \ since  is not.=active is an instance of e (i.e. ] without f­): a time-varying function is applied to a time-varying value pointwise; the era of the result is the combination of the function and value eras. Note, however, that  is not an instance of ]' since there is no way to implement fÚ: the era would have to be empty, but there is no such thing as an empty era (that is,  is not an instance of \).?active!Active values over a type with a d% instance are also an instance of dä. Two active values are combined pointwise; the resulting value is constant iff both inputs are.3  !"#$%&'()*+,-./0123   +, !"#$%&'()*-./012.5ç      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_]^`]ab]cd]ef]^g]^h]^i]^jklm]^nï#active-0.2.1-9HZw1r9u6s22XnBrvJbO0H Data.ActiveActiveDynamicera runDynamicEraDurationTimetoTimefromTime toDuration fromDurationmkErastartendduration mkDynamic onDynamic shiftDynamic fromDynamicmkActiveonActive modActive runActive activeStart activeEnd activeEra isConstant isDynamicuiintervalstretch stretchToduringshift backwardssnapshotclamp clampBefore clampAftertrim trimBefore trimAftersetEraatTimeafter->>|>>moviediscretesimulate$fRewrappedTimeTime $fWrappedTime$fRewrappedDurationDuration$fWrappedDuration $fAffineTime$fMonoidDuration$fSemigroupDuration$fAdditiveDuration$fApplicativeDuration$fSemigroupDynamic$fApplyDynamic$fMonoidActive$fSemigroupActive$fRewrappedActiveActive$fWrappedActive$fFunctorActive $fApplyActive$fApplicativeActive$fFunctorDynamic $fShowEra$fSemigroupEra $fEqDuration $fOrdDuration$fShowDuration$fReadDuration$fEnumDuration $fNumDuration$fFractionalDuration$fRealDuration$fRealFracDuration$fFunctorDuration$fEqTime $fOrdTime $fShowTime $fReadTime $fEnumTime $fNumTime$fFractionalTime $fRealTime$fRealFracTime $fFunctorTimebaseGHC.BaseMonoid ApplicativeGHC.NumNumGHC.Real Fractional GHC.MaybeNothingfmapFunctor<> Semigroup,semigroupoids-6.0.0.1-4alTQXJXT9lBqDEMW5fn3PData.Functor.Bind.ClassApplypure