úΠ š-^      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\](c) 2011 Brent YorgeyBSD-style (see LICENSE)byorgey@cis.upenn.eduNone$29:;<=DIRT3"An abstract type for representing points in time6. Note that literal numeric values may be used as Times, thanks to the the ^ and _ instances. An abstract type representing  elapsed timeo between two points in time. Note that durations can be negative. Literal numeric values may be used as Durations thanks to the ^ and _ instances. EA convenient wrapper function to convert a numeric value into a time. DA convenient unwrapper function to turn a time into a numeric value.There are two types of Active values:An  can simply be a >, that is, a time-varying value with start and end times.An f 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 a instances for .A  Dynamic a can be thought of as an a7 value that changes over the course of a particular  . It's envisioned that DynamicA 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. An Erad 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 EraH which acts as the identity with respect to this combining operation.Era is abstract. To construct Era values, use #; to deconstruct, use $ and %.!IA convenient wrapper function to convert a numeric value into a duration."HA convenient unwrapper function to turn a duration into a numeric value.# Create an   by specifying start and end s.$Get the start  of an  .% Get the end  of an  .& Compute the   of an  .' Create a = from a start time, an end time, and a time-varying value.( Fold for .)Shift a  value by a certain duration.* a is a b 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.+ is an instance of c (i.e. a without d­): 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 a' since there is no way to implement dZ: the era would have to be empty, but there is no such thing as an empty era (that is,   is not an instance of `).: Create an  value from a .;Create a dynamic = from a start time, an end time, and a time-varying value.< 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 .= Modify an I value using a case analysis to see whether it is constant or dynamic.> Interpret an  value as a function from time.?Get the value of an Active a at the beginning of its era.@Get the value of an Active a at the end of its era.AGet the   of an  value (or e$ if it is a constant/pure value).BTest whether an  value is constant.CTest whether an  value is .Dui represents the  unit interval, which takes on the value t at time t, and has as its era [0,1]. It is equivalent to E 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 uib 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 fp affects all values, both inside and outside the era. To manipulate values outside the era specifically, see L and O. To alter the values that ui/ takes on without altering its era, use its g and a instances. For example,  (*2) <$> ui varies from 0 to 2 over the era [0,1]$. To alter the era, you can use F or I.E interval a b% is an active value starting at time a, ending at time b, and taking the value t at time t.F stretch s act "stretches" the active act so that it takes s/ times as long (retaining the same start time).G stretchTo d Fes 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]Ha1 `during` a2 Fes and Is a1# so that it has the same era as a2. Has no effect if either of a1 or a2 are constant.I shift d act shifts the start time of act by duration d&. Has no effect on constant values.JhReverse an active value so the start of its era gets mapped to the end and vice versa. For example,  backwards D can be visualized as Hdiagrams/src_Data_Active_backwardsDia.svg#diagram=backwardsDia&width=200K\Take a "snapshot" of an active value at a particular time, resulting in a constant value.L]"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 D can be visualized as @diagrams/src_Data_Active_clampDia.svg#diagram=clampDia&width=200 See also M and N<, which clamp only before or after the era, respectively.M\"Clamp" an active value so that it is constant before the start of its era. For example,  clampBefore D can be visualized as Ldiagrams/src_Data_Active_clampBeforeDia.svg#diagram=clampBeforeDia&width=200See the documentation of L for more information.NZ"Clamp" an active value so that it is constant after the end of its era. For example,  clampBefore D can be visualized as Jdiagrams/src_Data_Active_clampAfterDia.svg#diagram=clampAfterDia&width=200See the documentation of L for more information.O?"Trim" an active value so that it is empty outside its era. trim" has no effect on constant values. For example, trim D 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 trimD is doing. To make this precise we could consider something like trim (First . Just  $ ui). See also P and  trimActive;, which trim only before or after the era, respectively.P+"Trim" an active value so that it is empty before' the start of its era. For example,  trimBefore D can be visualized as Jdiagrams/src_Data_Active_trimBeforeDia.svg#diagram=trimBeforeDia&width=200See the documentation of O for more details.Q+"Trim" an active value so that it is empty after& the end of its era. For example,  trimAfter D can be visualized as Hdiagrams/src_Data_Active_trimAfterDia.svg#diagram=trimAfterDia&width=200See the documentation of O for more details.RSet the era of an 2 value. Note that this will change a constant I into a dynamic one which happens to have the same value at all times.S 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.T 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.USequence/overlay two I values: shift the second to start immediately after the first (using T), then compose them (using h).V "Splice" two R values together: shift the second to start immediately after the first (using T§), 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.W.Splice together a list of active values using V . The list must be nonempty.X Create an ActiveH which takes on each value in the given list in turn during the time [0,1]G, 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.Ysimulate 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 rT, 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 values over a type with a b% instance are also an instance of bd. Two active values are combined pointwise; the resulting value is constant iff both inputs are.Fij k lm n!"#$%&'()*+,-./opq:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[r3  !"#$%&'():;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXY3 !" #$%&'();:BC<=>ARS?@DEFGHIJKLMNOPQTUVWXY>ij k lm n!"#$%&'()*+,-./opq:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[rU5s      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`a_bc_de_df_ghijk_dl_dm_dn_do_gpq r!stuvw&active-0.2.0.10-68e8GqEqxsPCGtMzU7qWzh Data.ActiveTime$fEqTime $fOrdTime $fShowTime $fReadTime $fEnumTime $fNumTime$fFractionalTime $fRealTime$fRealFracTime $fFunctorTimeDurationtoTimefromTime $fAffineTime $fWrappedTime$fRewrappedTimet $fEqDuration $fOrdDuration$fShowDuration$fReadDuration$fEnumDuration $fNumDuration$fFractionalDuration$fRealDuration$fRealFracDuration$fFunctorDurationActiveDynamicera runDynamicEra toDuration fromDurationmkErastartendduration mkDynamic onDynamic shiftDynamic$fSemigroupDynamic$fApplyDynamic$fMonoidDuration$fSemigroupDuration$fAdditiveDuration$fApplicativeDuration$fWrappedDuration$fRewrappedDurationt $fShowEra$fSemigroupEra$fFunctorDynamic$fFunctorActive $fApplyActive$fApplicativeActive$fWrappedActive$fRewrappedActivet fromDynamicmkActiveonActive modActive runActive activeStart activeEnd activeEra isConstant isDynamicuiintervalstretch stretchToduringshift backwardssnapshotclamp clampBefore clampAftertrim trimBefore trimAftersetEraatTimeafter->>|>>moviediscretesimulate$fMonoidActive$fSemigroupActive$fWrappedMaybeApply$fRewrappedMaybeApplytbaseGHC.NumNumGHC.Real FractionalGHC.BaseMonoid ApplicativeData.Semigroup Semigroup(semigroupoids-5.1-H8oAexw5PcHK8uFVfWF3M9Data.Functor.Bind.ClassApplypureNothingfmapFunctor<>unTimeD:R:UnwrappedTimeD:R:UnwrappedDurationD:R:UnwrappedActiveactiveD:R:UnwrappedMaybeApply