kF3      !"#$%&'()*+,-./012byorgey@cis.upenn.eduNone4There 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, 8 constant across time, with no start and end times. 'The addition of constant values enable 3 and 4  instances for . A  Dynamic a can be thought of as an a value that changes over  the course of a particular . It's envisioned that Dynamic = will be mostly an internal implementation detail and that  6 will be most commonly used. But you never know what & uses people might find for things. An Era6 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 3, since there is  no Era1 which acts as the identity with respect to this  combining operation. Era is abstract. To construct Era values, use  ; to  deconstruct, use   and . An abstract type representing  elapsed time between two points B in time. Note that durations can be negative. Literal numeric  values may be used as Durations thanks to the 5 and  6 instances.   and   are also 2 provided for convenience in converting between Durations and  other numeric types. "An abstract type for representing points in time . Note that ) literal numeric values may be used as Times, thanks to the the  5 and 6 instances.  and   are 7 also provided for convenience in converting between Time and  other numeric types. Convert any value of a 7 type (including Int, Integer,  Rational, Float, and Double) to a .  Convert a  to a value of any 6 type (such as  Rational, Float, or Double). Convert any value of a 7 type (including Int, Integer,  Rational, Float, and Double) to a .  Convert a  to any other 6 type (such as  Rational, Float, or Double).  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. 8%Ideally this would be defined in the newtype package. If it is * ever added we can remove it from here.  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 F apply if it is a pure (constant) value, and a function to apply if  it is a .  Modify an / 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. Get the  of an  value (or 9 if it is  a constant/ pure value). Test whether an  value is constant. Test whether an  value is . ui 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:  /http://www.cis.upenn.edu/~byorgey/hosted/ui.png *On the x-axis is time, and the value that ui takes on is on the B y-axis. The shaded portion represents the era. Note that the  value of ui3 (as with any active) is still defined outside its @ era, and this can make a difference when it is combined with A other active values with different eras. Applying a function  with :6 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 ; and 4 instances. For example,  (*2) <$> ui varies from 0 to 2 over the era [0,1]. To  alter the era, you can use  or ".  interval a b% is an active value starting at time a , ending at  time b, and taking the value t at time t.  stretch s act " stretches" the active act so that it takes  s0 times as long (retaining the same start time).  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. !a1 `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. " shift d act shifts the start time of act by duration d. % Has no effect on constant values. #?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  6http://www.cis.upenn.edu/~byorgey/hosted/backwards.png $Take a "snapshot"* of an active value at a particular time, " resulting in a constant value. %"Clamp"9 an active value so that it is constant before and after  its era. Before the era, clamp a takes on the value of a at 3 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  2http://www.cis.upenn.edu/~byorgey/hosted/clamp.png  See also & and ', which clamp only before # or after the era, respectively. &"Clamp"9 an active value so that it is constant before the start  of its era. For example,  clampBefore  can be visualized as  8http://www.cis.upenn.edu/~byorgey/hosted/clampBefore.png See the documentation of % for more information. '"Clamp"6 an active value so that it is constant after the end  of its era. For example,  clampBefore  can be visualized as  7http://www.cis.upenn.edu/~byorgey/hosted/clampAfter.png See the documentation of % for more information. ("Trim"6 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  1http://www.cis.upenn.edu/~byorgey/hosted/trim.png  Actually, trim ui/ is not well-typed, since it is not guaranteed  that ui'/s values will be monoidal (and usually they won't be)! D 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. )"Trim"% an active value so that it is empty before the start  of its era. For example,  trimBefore  can be visualized as  7http://www.cis.upenn.edu/~byorgey/hosted/trimBefore.png See the documentation of ( for more details. *"Trim"% an active value so that it is empty after the end  of its era. For example,  trimAfter  can be visualized as  6http://www.cis.upenn.edu/~byorgey/hosted/trimAfter.png See the documentation of ( for more details. +Set the era of an & value. Note that this will change a  constant . into a dynamic one which happens to have the  same value at all times. , 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. -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. .Sequence/ overlay two # values: shift the second to start & immediately after the first (using -), then compose them  (using <). /"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 B point, then like the second after that. If both are constant,  return the first. 0.Splice together a list of active values using / . The list  must be nonempty. 1 Create an Active0 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"6 that starts at time 0 and ends at time 1. The first A 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. 2simulate r act simulates the  value act, returning a  list of " snapshots"+ taken at regular intervals from the start A 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 1 value is constant (and thus has no start or end C times), a list of length 1 is returned, containing the constant  value. =!Active values over a type with a > instance are also an  instance of >". Two active values are combined C pointwise; the resulting value is constant iff both inputs are. ? a is a > whenever a is: the eras are C combined according to their semigroup structure, and the values  of type a$ are combined pointwise. Note that  a cannot  be an instance of 3 since  is not. @ is an instance of A (i.e. 4 without  B8): a time-varying function is applied to a time-varying D value pointwise; the era of the result is the combination of the 1 function and value eras. Note, however, that  is not  an instance of 4$ since there is no way to implement  B7: the era would have to be empty, but there is no such # thing as an empty era (that is,  is not an instance of  3). ECDEFGH 8 !"#$%&'()*+,-./012I=JK?@LMNOP3  !"#$%&'()*+,-./0123   +, !"#$%&'()*-./012<CDEFGH 8 !"#$%&'()*+,-./012I=JK?@LMNOPQ      !"#$%&'()*+,-./012345647849:4;<4;=>4?@4AB4ACDEFGDEHIJKLM47NOPQRSTUVWXYactive-0.1.0.3 Data.ActiveActiveDynamicera runDynamicEraDurationTimetoTimefromTime toDuration fromDurationmkErastartendduration mkDynamic onDynamic shiftDynamic fromDynamicmkActiveonActive modActive runActive activeStart activeEnd activeEra isConstant isDynamicuiintervalstretch stretchToduringshift backwardssnapshotclamp clampBefore clampAftertrim trimBefore trimAftersetEraatTimeafter->>|>>moviediscretesimulatebase Data.MonoidMonoidControl.Applicative ApplicativeGHC.NumNumGHC.Real FractionalRealover2 Data.MaybeNothingGHC.BasefmapFunctorsemigroups-0.9Data.Semigroup<>$fSemigroupActive Semigroup$fSemigroupDynamic$fApplyDynamicsemigroupoids-3.0.1Data.Functor.BindApplypure unDurationunTime$fMonoidActive$fNewtypeMaybeApplyEither$fNewtypeActiveMaybeApply$fAffineSpaceTime$fVectorSpaceDuration$fNewtypeDurationRatio$fVectorSpaceTime$fNewtypeTimeRatio