1EG      !"#$%&'( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E FGHIJKLMNOPQRSTUVWXYZ[\ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z {|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFBNone1N GCMutable vector with dynamic behaviour living in the ST or IO monad.H$O(1) access to the underlying vectorIO(N*log(N)) unstable sort.J!Number of elements in the vector.KDNumber of elements that the vector currently has reserved space for.L&Create a vector with a given capacity.M(Read by index. Performs bounds checking.N&Read by index without bounds checking.O"Clear the vector, set length to 0.+Does not reallocate, capacity is unchanged.P?Increment the size of the vector and write a value to the back.LCapacity, must be positive QRHIJKLMNOPSTUVGWSafeM^Bresenham's line algorithm. Includes the first point and goes through the second to infinity.SafeXSource: Shttps://www.reddit.com/r/haskell/comments/14h4az/3d_functional_bresenham_algorithm/Oslightly modified to fix a bug when rise1 == rise2, rise1 >run and rise2 > run&3D version of the bresenham algorithm.;Returns the 3D bresenham length between two 3D coordinates.Safe!WPhantom type : accelerationPhantom type : velocityPhantom type : positionSafe#0Continuous 2d coordinates. We use phantom types , , E to distinguish between a position, a velocity, and an acceleration.Safe.Instances should satisfy: \forall (\, from, to)\, \in v,  from to >= 0 from to can be different from  to fromJ, to provide different forward and backward interpolations (or morphings).Distance between two s.Distance between n successive s.6Wrapper on a list, to represents successive waypoints.YInterpolation between 2 lists, occuring in parallel between same-index elements. Prerequisite : lists have the same lengths.oFor an interpolation that occurs sequentially between same-index elements, use SequentiallyInterpolatedList.ZNave interpolation. first value last valueGthe number of steps (including first and last) to go from first to lastSafeNReturns the time  t \in [\,0,1]\,  at which a value  y \in [\,0,1]\, is reached given a  http://gizma.com/easing/4th order ease in-out function  quartEaseInOut : y = quartEaseInOut(t) = \begin{cases} {1 \over 2} * (2*t)^4, & \;\;\;\; \text{if $t <{1 \over 2}$} \\[2ex] -{1 \over 2} * \left( [ 2*(t-1) ]^4 - 2 \right), & \;\;\;\; \text{if $t >{1 \over 2}$} \end{cases} To find the formulas of , we need to invert  quartEaseInOut , i.e. we need to express t in terms of y: \text{$quartEaseInOut$ is strictly increasing} \implies \begin{cases} t<{1 \over 2} \iff y<{1 \over 2} \\ t>{1 \over 2} \iff y>{1 \over 2} \end{cases} ; \begin{alignedat}{3} \text{if $y <{1 \over 2} $, given the $quartEaseInOut$ equation for $t <{1 \over 2} $ :} && y &= {1 \over 2} * (2*t)^4 && \\ \implies && \quad t &= \left({y \over 2^3}\right)^{1/4} && \quad \forall y <{1 \over 2} \\ \text{if $y >{1 \over 2} $, given the $quartEaseInOut$ equation for $t >{1 \over 2} $ :} && y &= - {1 \over 2} * \left( [2*(t-1)]^4 - 2 \right) && \\ \implies && \quad t &= 1-\left[{1-y \over 2^3}\right]^{1/4} && \quad \forall y >{1 \over 2} \end{alignedat} VNote that there are multiple solutions, we chose the ones that produce results in the  [\,0,1]\,  range.Hence, the formulas for  are : t = invQuartEaseInOut(y) = \begin{cases} \left({y \over 2^3}\right)^{1/4}, & \text{if $y <{1 \over 2}$} \\[2ex] 1-\left[{1-y \over 2^3}\right]^{1/4}, & \text{if $y >{1 \over 2}$} \end{cases} <Adapts continuous inout ease functions to the discrete case.!Returns the time (in range [0 1]) at which a value (in range [0 1]) is reached given a 4th order ease in-out function, and a total number of discrete steps.Value :  y Time :  t 4Continuous (optionally inverse) ease in/out functionThe number of discrete steps Input value (optionnaly inverse) Eased value!The number of discrete stepsValueTime ! !SafeP'wHelper function to run an action and restore the console settings when it is finished or when an exception was thrown."#$%&'"#$NoneQ^[ Buffer types \]^_`abcdef[^_`abcd NoneKT( Iterator of ,*The *3 at which the iteration occurs (if speed >1, some (s are skipped).,An , has a * and an iterator: (/Iterates forward.0Iterates backward. ()*+,-./01 ,-*+()1./0()*+,- NoneYA5Was the thread termination normal or due to an error?DZRuns an IO action in a separate thread, and waits for it to finish, returning its result.ESets the number of capabilities to half the number of processors. Not used at the moment since we don't use parallelism too much.ABCDEDABCEABCSafe]F%Represents deadlines and event times.HAdds a  to a I Returns t1-t2J Convert a  to a number of microseconds.K1Converts a duration expressed in seconds using a g to a # which has picosecond resolution.LAdds a  to a F.It1t2  FGHIJKL FGLHIJK  FGSafegTP=If list is a singleton, show the element, else show the list.QAReplicates each list element n times and concatenates the result.R9Builds a range with no constraint on the order of bounds: *range 3 5 == [3,4,5] range 5 3 == [5,4,3] SVReturns a list of random values uniformly distributed in the closed interval [lo,hi].'It is unspecified what happens if lo>hiV,Expects the bounds to be in the right order.RFirst inclusive boundSecond inclusive boundSlo : lower boundhi : upper boundV The valueThe inclusive minimum boundThe inclusive maximum boundPQRSTUVPQRTUSVSafezW4Instances should statisfy the following constraints:;An interpolation between A and B starts at A and ends at B: \forall (\, from, to)\, \in v,  [ d = distance from to interpolate from to 0 == from interpolate from to d == to ?The interpolation path is composed of strictly distinct points: A length $ nubOrd $ map (interpolate from to) [0..pred d] == d Given any points A,B belonging the path generated by an interpolation, the interpolation beween A and B will be the points of the path between A and B:W \forall med \in [\,0,d]\,, \forall low \in [\,0,med]\,, \forall high \in [\,med,d]\,,  distance from med + distance med to == 1 + distance from to medVal = interpolate from to med interpolate from to low == interpolate from medVal low interpolate from to high == interpolate medVal to $ high-med X3Implement this function if you want to interpolate by value3, i.e the result of the interpolation between two v is a v.hmInterpolate in parallel between 2 lists : each pair of same-index elements is interpolated at the same time.iNave interpolation.X first value last valuethe current stepthe interpolated valueWXYWXYSafeZA ListY-like type to interpolate sequentially (one index at a time) between same-index elements.jInterpolation between 2 Z, occuring sequentially i.e interpolating between one pair of same-index elements at a time, starting with 0 index and increasing. Prerequisite : lists have the same lengths.kInterpolation between 2 Z, occuring sequentially i.e interpolating between one pair of same-index elements at a time, starting with 0 index and increasing. Prerequisite : lists have the same lengths.Z[Z[ NoneKl1Represents the rgb and grayscale xterm 256 colorsQThe ranges of colors that can be represented by each constructor are specified  5https://en.wikipedia.org/wiki/ANSI_escape_code#Colorshere.mcorresponding ANSI range:a[0x10-0xE7]: 6 6 6 cube (216 colors): 16 + 36 r + 6 g + b (0 "d r, g, b "d 5)ncorresponding ANSI range:@[0xE8-0xFF]: grayscale from dark gray to near white in 24 steps\4ANSI allows for a palette of up to 256 8-bit colors._A background and a foreground \.o7Components are expected to be between 0 and 5 included.cCreates a rgb \ as defined in 4https://en.wikipedia.org/wiki/ANSI_escape_code#8-bitANSI 8-bit colors3Input components are expected to be in range [0..5]dCreates a gray \ as defined in 4https://en.wikipedia.org/wiki/ANSI_escape_code#8-bitANSI 8-bit colorsGInput is expected to be in the range [0..23] (from darkest to lightest)p Converts a \ ^ to corresponding  (https://vt100.net/docs/vt510-rm/SGR.html SGR codes.q Converts a \ ] to corresponding  (https://vt100.net/docs/vt510-rm/SGR.html SGR codes.r>Computes the bresenham length between two colors. If both are d0, the interpolation happens in grayscale space.s.Returns the bresenham path between two colors. If both are d/, the interpolation happens in grayscale space. If one is a d and the other c, the d) one will be approximated by the closest c9 in the direction of the other color, so as to produce a  monotonic interpolation. t Converts a \ to a l.u Converts a l to a \.e Creates a _ with a black background color.f Creates a _2 with white foreground and black background color.v`converts a GrayColor to a RGBColor, using another RGBColor to know in which way to approximate.w*Using bresenham 3D algorithm in RGB space.x*Using bresenham 3D algorithm in RGB space.y9First interpolate background color, then foreground colorz9First interpolate background color, then foreground colorcred component in [0..5]green component in [0..5]blue component in [0..5]dgray value in [0..23]v=We'll round the resulting r,g,b components towards this colorThe gray component{7rgb target component to know in which way to appoximategray component rgb component|gray component rgb component"}lnm\]^_`abo~cdpqrsefghijklmnlmn\_`abo~!None@Computes color to be applied when a character is inserted in a  ColorStringH (during inteprolation) so that color matches right and or left colors.fromtoprogress(result,nSteps) | >=0 : "remaining until completion" | <0 : "completed since" (using abolute value)) NoneMaps a o to a list of  and _M. It is used to simplify the implementation of some interpolation algorithmssCounts the chars in the ou+First interpolating characters, then color.v+First interpolating characters, then color.fromtoprogress _`abopqrs oprqs_`abop None\]^_`abcdefghijklmn\cd_`ab]^efmnghklji"NoneyAccess one graphical element's _.yzyz#None;=K{4A segment is a line betwen two discrete coordinates.$It can be materialized as a list of  using |Horizontal segment}Vertical segment~Oblique segment-Represents a discrete size (width and height)Phantom type for heightPhantom type for widthDiscrete length;Two-dimensional discrete coordinates. We use phantom types , ' to distinguish positions from speeds.Represents a column index (x)Represents a row index (y)Discrete coordinate.Discrete directions.Width and Height to Coords.Returns the bigger dimension (width or height) Tests if a b lies on the outer border of a region of a given size, containing (0,0) and positive coordinates. Tests if a m is contained or on the outer border of a region of a given size, containing (0,0) and positive coordinates.:Returns the bresenham 2d distance between two coordinates.MBresenham 2d algorithm, slightly optimized for horizontal and vertical lines.#Using bresenham 2d line algorithm.#Using bresenham 2d line algorithm.The coordinates to testThe size0If the coordinates are on the border, returns a ; pointing away from the region (at the given coordinates). Segment start Segment end"{|}~{|}~$None4Represents a discrete position and a discrete speed.%None3(Represents a key-press, read from stdin.An alphanumeric key One of the four direction arrowsThe escape keyAn unhandled key&None];Blocks until a key is read from stdin. Then, flushes stdin.returns when stdin is empty'None]VATries to read a key from stdin. If it succeeds, it flushes stdin.None̓(NoneK; 'The delta-buffer is used in renderFrameBuffer element indexBuffer size (width * height) Specifies when to clear the back-buffer.GClears the back-buffer after allocation and after each frame render.Clears the back-buffer after allocation only. Typically, you will use it if at every frame you draw at every screen location. If you don't redraw every screen location at every frame, it is safer to use p, else you will see previous frame elements in the rendered frame (unless you intend to have this behaviour).When and how to resize buffers.KAfter each render, buffers are resized (if needed) to match terminal size.Buffers have a fixed size. If they are vertically or horizontally bigger than the terminal, rendering artefacts will be visible.\\)None= = = n=  $  *None]+Nonei,Noneۦ-NoneLCreates buffers for given width and height, replaces 0 width or height by 1.\.None5Convert a discrete position to a continuous position.5Convert a continuous position to a discrete position./Convert a discrete speed to a continuous speed./Convert a continuous speed to a discrete speed.Nonef Creates a list of 4 7 from a single one by rotating it successively by pi/2. Sums two . Multiplies a  by a scalar.JIntegrate twice a constant acceleration over a duration, return a position@Integrate a constant velocity over a duration, return a positionUsing  1https://en.wikipedia.org/wiki/Equations_of_motion?equation [2] in "Constant linear acceleration in any direction":: \vec r = \vec r_0 + \vec v_0*t + {1 \over 2}* \vec a*t^2  where  \vec r = current\;position  \vec r_0 = initial\;position  \vec v_0 = initial\;velocity  \vec a = gravity\;force  t = time >Samples a circle in an optimized way, to reduce the number of  and  calls.:The total number of points will always be a multiple of 4.Samples a circle.?Returns the extremities of a polygon. Note that it is equal to CenterRadius2The angle corresponding to the first sampled point#The total number of sampled points per quarter arc.CenterRadius2The angle corresponding to the first sampled point"The total number of sampled pointsCenterRadiusRotation angleNumber of sides of the polygon./NoneF The reach of the laser.+Tells which obstacles are destroyed on the { of   The first obstacle is destroyed.All obstacles are destroyed.9The laser ray was computed taking obstacles into account.-The laser ray was computed ignoring obstacles A Laser ray:A laser ray and the direction in which the laser was shot.)The direction in which the laser was shotThe laser trajectory. 0Safe#hResamples a list, using the analogy where a list is seen as a uniform sampling of a geometrical segment.9With a uniform sampling strategy, for an input of length  n !, and a desired output of length  m :Regular samples are repeated ! r = \lfloor {m \over n} \rfloor  times.Over-represented samples are repeated  r + 1  times.If  m' + is the number of over-represented samples,j \begin{alignedat}{2} m &= r*n + m' \\ \implies \quad m' &= m - r*n \end{alignedat} EWe can chose over-represented samples in at least two different ways: Even spread :3Given a partition of the input continuous interval  [\,0, length]\,  in  m' p equal-length intervals, the over-represented samples are located at the (floored) centers of these intervals.5More precisely, over-represented samples indexes are: \biggl\{ a + \Bigl\lfloor {1 \over 2} + { n-1-a \over m-1 } * s \Bigl\rfloor \mid s \in [\,0\,..\,m'-1] \;,\; a = {1 \over 2} * {n \over m'} \biggl\} ?Example : for a length 5 input, and 2 over-represented samples: H input samples: ----- over-represented samples: - - "Even with extremities" spread:#The first and last over-represented samples match with an input extremity. The rest of the over-represented samples are positionned "regularly" in-between the first and last. An exception is made when there is only one over-represented sample : in that case it is placed in the middle.5More precisely, over-represented samples indexes are:K if \; m' == 1 : \biggl\{ \Bigl\lfloor {n-1 \over 2} \Bigl\rfloor \biggl\} s otherwise : \biggl\{ \Bigl\lfloor {1 \over 2} + {n-1 \over m'-1}*s \Bigl\rfloor \mid s \in [\,0,m'-1]\, \biggl\} ?Example : for a length 5 input, and 2 over-represented samples: I input samples: ----- over-represented samples: - - LAs its name suggests, this function uses the "even with extremities" spread.UFor clarity, the variable names used in the code match the ones in the documentation.5Returns maxBound when there is no over-representationInput n % : input length. It is expected that  0 <= n <=   length input m & : output length. It is expected that  0 <= m .Output :when  m < n  , it is a  downsampled version of the input,when  m > n  , it is an  upsampled version of the input.over-represented samples count n  : input length. current indexH(next overrepresentation index, count of over-represented samples sofar)the list to be resampled r = floor(m/n) & : every sample will be replicated  r  times, or  r + 1 2 times if distance to next overrepresentation == 0 the inputthe number of samples the outputNone/  =  0 0 Returns a - b Returns a + b-Assumes that we integrate over one game step. Returns a + bKReturns the coordinates that correspond to one step in the given direction.)Translate of 1 step in a given direction.7Modify the end of the segment to reach the given length'Returns the distance from segment start&Returns the start and end coordinates. = &Translate by a given height and width.aba - baba + bThe coordinates to test* if the coordinate is not contained, else " the distance from segment start.The height to addThe width to addTake that many stepsIn that directionFrom these coordinatesstart of the segment in which to extend0Continue extension while this functions returns .4{|}~4{|}~1NoneBm @The kind of speed mirroring to apply in reaction to a collision.Mirror the y coordinateMirror the x coordinateMirror x and y coordinates5no collision on the trajectory, position is unchangedsa collision exists on the trajectory, position was changed to be just before the collision and speed was mirrored Describes if a collision exists. No collision.A collision exists.DOn collision, mirrors speed and moves to the pre-collision position.`Handles the first collision on a trajectory, assuming that the first position has no collision.Mirrors a speedWhen continuing with current speed, if at next iteration we encounter a wall (or go through a wall for diagonal case), we change the speed according to the normal of the closest wall before collisionInteraction function.Input position and speed."The speed was potentially mirroredThe collision function.EThe trajectory (the first position is expected to be collision-free).oOn collision, the kind of speed mirroring that should be applied and the position just before the collision.NoneB NoneU The kind of alignment.The reference coordinates.Specifies where the Text$ is w.r.t the reference coordinates.Centered( on reference coordinates, favoring the . side in case of ambiguity:  1 12 123 1234 ^ Left, of the reference coordinates, including it:  1 12 123 1234 ^ Right, of the reference coordinates, including it: 1 12 123 1234 ^ Computes starting coordinates where from we should draw a series of characters of a given length, to meet the alignment constraint.Given a number of characters and an alignment, returns the displacement that should be done relatively to the reference coordinates in order to find the first character .For , when we have an evenK count of characters to draw, we (somewhat arbitrarily) chose to favor the  , as illustrated here where ^ indicates where the reference  is:  1 12 123 1234 ^ 4Note that this choice impacts the implementation of 2.-Moves the reference coordinate one line down.3The text will be written left of these coordinates./The text will be centered on these coordinates.number of characters to drawCount of characters 3None_Draw a Draws a P multiple times, starting at the given coordinates and then moving to the right.deltaDrawChars n c should be faster than deltaDrawStr (repeat n c)', as the encoding of information in a ]@ happens once only. (TODO verify in GHC core with optimizations)Draw a Draw a *Fills the entire area with a colored char.Location Background and foreground colorsNumber of chars to drawLocation of left-most  Background and foreground colorsLocation of first  Background and foreground colorsLocation of first  Background and foreground colors<\]^_`abcdefghijklmn{|}~4Nonea5Nonei^Flushes the frame, i.e renders it to the console. Then, resizes the context if needed (see %) and clears the back buffer (see ).The command to set the cursor position to 123,45 is "ESC[123;45H", its size is 9 bytes : one order of magnitude more than the size of a char, so we avoid sending this command when not strictly needed.the buffer indexthe buffer index8True if a char was rendered at the previous buffer index0-based row to move to0-based column to move to6NonenUDraw a .Draw repeated chars.Draw .Draw .Draw a o.<Draw text aligned w.r.t alignment and reference coordinates.=Draws text aligned w.r.t alignment and reference coordinates. Returns an - where the reference coordinate of the input ! was projected on the next line.Draw a o with an  constraint. 7Noner7Class describing the ability to render the result of a  to the screen.VIt is left to the implementation to decide wether to clear the screen or not (after a renderToScreen% for example), and with which color. Render to the screen.None}+FOR TESTS ONLY. For production, please use Imj.Graphics.Render.Delta.:Naive rendering for the terminal : at every call it sends color and position change commands, hence  ,https://en.wikipedia.org/wiki/Screen_tearingscreen tearingf happens very quickly as a consequence of stdout buffer being automatically flushed to avoid overflow.To fix this problem, Imj.Graphics.Render.Deltab uses double buffering techniques to limit the actual number of rendering commands sent to stdout.kDirect draw to stdout : don't use for production, this is for tests only and creates heavy screen tearing.kDirect draw to stdout : don't use for production, this is for tests only and creates heavy screen tearing.8NoneDraw a o.Draw a o with an  constraint.Draws text with .Draws text with . Returns the  projected on the next line.Draws a Q multiple times, starting at the given coordinates and then moving to the right.8Render the drawing to {the screen, the console, etc...}. 9NoneF.Creates an environment using default policies.%Creates an environment with policies. Sets the * for back and front buffers. Defaults to  when Nothing is passed. Sets the . | Defaults to  when Nothing is passed.  Sets the \& to use when clearing. Defaults to  when Nothing is passed. Sets stdout's . Defaults to  when Nothing is passed.)Renders using the delta rendering engine.'Draws using the delta rendering engine.Preferred stdout .  None% _`ab%_`ab :None*Dimensions of the content of the container@Coordinates of the upper left corner of the container, from, to.NoneJ@ "#$%&'_`ab  $  "#$%&';None<None A  Y is a graphical element that knows how to draw itself (it knows its color and position).  Draw the      =None;=F Morph between drawn representations of Drawbles. Drawn representation of   x8The visual result of IO rendering commands induced by a   x call.4Instances should statisfy the following constraints:A morphing between drawn* representations of A and B starts at the drawn% representation of A and ends at the drawn represntation of B: \forall (\, from, to)\, \in v,   d = distance from to drawMorphing from to 0 "is the same as" draw from drawMorphing from to d "is the same as" draw to 3The morphing path is composed of strictly distinct drawings.The drawings;, when seen in rapid succession, should visually produce a smooth+ transformation from the first to the last drawing. Draws the morphing between the drawn representations of 2 v.Draws the morphing between the drawn representations of several v. first value last valuethe current step     >None$ 9Defines an evolution (interpolation or morphing) between  s. s.The frame at which the  value is equal to the last  value.)Duration of the interpolation in seconds.Inverse ease function.Used to synchronize multiple s.An evolution between n "s. With a 4th order ease in & out.An evolution between n 1s. With a user-specified (inverse) ease function.Constructor of .Computes the time increment between the input ( and the next.Gets the value of an  at a given (. Draws an  at a given (..To make sure that we never use distance on an .(s through which the evolution will pass.Duration in seconds Inverse continuous ease function(s through which the evolution will pass.Duration in secondsDuration in seconds Last frame;Inverse ease function (value -> time, both between 0 and 1)QIf evolution is still ongoing, returns the time interval between the input ( and the next.The evolution value.?NoneA # is a colourless graphical element. To draw a , we need to pass a _.@None Like   , except the   constraint is replaced by a  constraint:Morph between drawn representations of . Drawn representation of  x8The visual result of IO rendering commands induced by a  x call.4Instances should statisfy the following constraints:A morphing between drawn) representations of A and B start at the drawn% representation of A and ends at the drawn represntation of B:. \forall (\, from, to)\, \in v, \forall color   d = distance from to drawMorphingUsingColor from to 0 color "is the same as" drawUsingColor from color drawMorphingUsingColor from to d color "is the same as" drawUsingColor to color 3The morphing path is composed of strictly distinct drawings.The drawings;, when seen in rapid succession, should visually produce a smooth+ transformation from the first to the last drawing.!A X is colourless so it wouldn't know in which color to draw itself, hence here we pass a _.     ! !None]:Considering a closed continuous path with an even number of points labeled A and B and alternating along the path : A,B,A,B,A,Bh(Think of a rectangle, the middles of the sides being the A points, the extremities being the B points)YFromBs is the complement, i.e the same as above, but replacing As with Bs and vice-versa.rFirst draw A points, then expand the drawn regions to the right and left of A points, until B points are reached.rFirst draw B points, then expand the drawn regions to the right and left of B points, until A points are reached." r----------------------------+ | u--+ | | |//| | | |//| | | +--l | | | +----------------------------+ r = Terminal origin, at (0,0) / = RectContainer's content, of size (2,2) u = RectContainer's upper left corner, at (2,1) l = RectContainer's lower left corner, at (5,4) $Content size.%Upper left corner.&{Returns points centered on the sides of a container which is at a given distances (dx and dy) from the reference container. .container at a distance from another containerIn this illustration, cont' is at dx = dy = 3 from cont:  cont' +--------+..- | | | dy = 3 | cont | | | +--+..|..- | | | | | | | | | +--+ | | . | | . | +--------+ . . . . >|--|< dx = 3  1Favored direction for centers of horizontal sidesWhen computing the center+ of an horizontal side, if the side has an even length, we must favor a  . (Note that if the side has an odd length, there is no ambiguity.)In AB implementation, AC alignment favors the  :  1 12 123 1234 ^ If we, too, favor the  5, when the returned point is used as reference for a Centered4 alignment, the text will tend to be too far to the , as illustrated here (^ indicates the chosen center): 5 1 +--+ 12 +--+ 123 +--+ 1234 +--+ ^ So we will favor the  ', to counterbalance the choice made in AB 's implementation: 0 1 +--+ 12 +--+ 123 +--+ 1234 +--+ ^ (iSmoothly transforms the 4 sides of the rectangle simultaneously, from their middle to their extremities.Progress of the interpolationSize of the content, not the containerThe building strategy&Reference containerHorizontal distanceHorizontal distance3(center Up, center Down, center Left, center Right)"#$%&"#$%&"#$%None'()*+,-./01WXYZ[  !WXY  !Z[None50, can wrap a   , to make a  .&Interpolates the color and morphs the  at the same time.1&Interpolates the color and morphs the  at the same time.2, can wrap a , to give it a notion of color.,-./,-./,-./None5 Interpolates os and anchors.:One anchor per Character;One anchor per String<Render a string-anchored 5 for a given (=Render a char-anchored 5 for a given (?>Translates text in an animated way,ete character by character.Examples are given in .Imj.Example.SequentialTextTranslationsAnchored.@$Translates text in an animated way, o by o.Examples are given in .Imj.Example.SequentialTextTranslationsAnchored.A Translates a o between two anchors.?'List of (texts, from anchor, to anchor)duration in seconds@'List of (texts, from anchor, to anchor)Duration in secondsADuration in secondsLeft anchor at the beginningLeft anchor at the end4()*+,-./01WXYZ[  !56789:;<=>?@A 56789:;A?@=<>56789DNone UUsed when transitionning between two levels to smoothly transform the aspect of the "+, as well as textual information around it.The transformation of the ".GThe transformation of colored text at the top and at the bottom of the ".9The transformation of colored text left and right of the ".%Manages the progress and deadline of .Time at which the  should be rendered and updatedCurrent ,.Is the  finished?ACompute the time interval between the current frame and the next. Creates the 55 to animate the texts that appears left of the main "FromTo"Time at which the animation startsFromTo"Upper text, Lower text, Left textsAlignment ref fromAlignment ref to6Each inner list is expected to be of length 1 or more.If length = 1, the o1 is not animated. Else, the inner list contains o waypoints.The duration of the animation/Each list is expected to be of size at least 1. Noneyz  yz  ENone %None]1CSame as D but offsets the start  by one in the shot .D Creates a  by extending from a  until a collision is found.E Returns the # that is just after the end of the F Converts a  laser ray to an  one, taking obstacles and a  into account.NReturns a partition of obstacles between the remaining and the destroyed ones.CStart coordinatesDirection of the shotCollision functionF Obstacles. Obstacle to  function.The * that doesn't take obstacles into account.CDEFDCFEFNoneDShows the differences between : and ;&, by comparing, with the same inputs:? / =@ / <rshows an example with multiple strings : global color is changed in parallel but anchors are changed sequentially5()*+,-./01WXYZ[  !56789:;<=>?@AGHIJKLJMNJOPJQRJQSJQTJQUVWXYZ[\]^\]_\]`\]a\]b\cdefghijkklmnopqqrstuvwxyz { { | | } } ~             ""################################$$$$%%%%%&'(((((())))....//////// / / / / / 0 11111 1!1"1#$$%&'C()*+,B-6.6/60616263646566777899:;8<8=8>8?8@8A8B8C8D9E9F9G9H9I9J9K<L<M=N=O=P>Q>Q>R>S>T>U>V>V>W>X>Y>Z>[>\?]?^@_@`aabc2defghiijklmnopqqrstuvwxyz{|}~JGH                 J       !!  ##&(((J(((((((((((((((JMJ*****+,,---JJ000JMGH11111133333345555999E::::;>>>D D D D D DDDDDDDDD D DDDEFFFFFFFFF F!F!"'imj-base-0.1.0.2-9rOFbRRrBF3LpP215oW1G4Imj.Graphics.RenderImj.UtilImj.Graphics.Render.Delta Imj.TimingImj.Geo.DiscreteImj.Geo.ContinuousImj.Graphics.InterpolationImj.Graphics.Math.Ease Imj.Iteration Imj.ThreadingImj.Graphics.ColorImj.Graphics.Text.ColorStringImj.Graphics.ClassImj.Physics.Discrete Imj.InputImj.GameItem.Weapon.LaserImj.Graphics.Text.AlignmentImj.Graphics.Render.NaiveImj.Graphics.UI.RectContainerImj.Graphics.UI.ColoredImj.Graphics.Text.Animation'Imj.Data.Vector.Unboxed.Mutable.DynamicImj.Geo.Discrete.BresenhamImj.Geo.Discrete.Bresenham3 Imj.Geo.TypesImj.Geo.Continuous.Types#Imj.Graphics.Class.DiscreteDistance!Imj.Graphics.Render.Delta.Console(Imj.Graphics.Render.Delta.Internal.Types(Imj.Graphics.Class.DiscreteInterpolation7Imj.Graphics.Interpolation.SequentiallyInterpolatedListImj.Graphics.Color.Types+Imj.Graphics.Text.ColorString.Interpolation"Imj.Graphics.Class.HasLayeredColorImj.Geo.Discrete.TypesImj.Physics.Discrete.TypesImj.Input.TypesImj.Input.BlockingImj.Input.NonBlockingImj.Graphics.Render.Delta.Types)Imj.Graphics.Render.Delta.DefaultPoliciesImj.Graphics.Render.Delta.CellImj.Graphics.Render.Delta.Cells,Imj.Graphics.Render.Delta.Buffers.Dimensions!Imj.Graphics.Render.Delta.BuffersImj.Geo.Continuous.ConversionImj.GameItem.Weapon.Laser.TypesImj.Geo.Discrete.ResampleImj.Physics.Discrete.CollisiongetSideCentersAtDistanceImj.Graphics.Render.Delta.DrawImj.Graphics.Render.Delta.ClearImj.Graphics.Render.Delta.FlushImj.Graphics.Class.DrawImj.Graphics.Class.Render#Imj.Graphics.Render.FromMonadReaderImj.Graphics.Render.Delta.Env,Imj.Graphics.UI.RectContainer.MorphParallel4'Imj.Example.DeltaRender.FromMonadReaderImj.Graphics.Class.Drawable#Imj.Graphics.Class.DiscreteMorphing$Imj.Graphics.Interpolation.EvolutionImj.Graphics.Class.Colorable,Imj.Graphics.Class.DiscreteColorableMorphingText.AlignmentalignCenteredImj.Graphics.UI.Animation#Imj.Example.DeltaRender.FromMonadIO.Imj.Example.SequentialTextTranslationsAnchoredghc-prim GHC.TypesCharbaseGHC.IntInt64GHC.BaseStringControl.Monad.IO.ClassMonadIOGHC.IO.Handle.TypesBlockBuffering LineBuffering NoBuffering BufferMode"text-1.2.2.2-9VTsh6V7U7hpagw2HDvpZData.Text.InternalText mtl-2.2.1-DscMMmDQUE6GBfOSl4qMUHControl.Monad.Reader.Class MonadReader time-1.8.0.2#Data.Time.Clock.Internal.SystemTime getSystemTimesystemNanoseconds systemSeconds MkSystemTime SystemTime!Data.Time.Clock.Internal.DiffTimeDiffTimebla bresenham3bresenham3LengthAccVelPosVec2_vec2X_vec2YDiscreteDistancedistancedistanceSuccessive SuccessiveinvQuartEaseInOutdiscreteAdaptordiscreteInvQuartEaseInOut ConsoleConfigGamingEditingconfigureConsoleForrestoreConsoleSettingsrunThenRestoreConsoleSettingsFrameSpeed Iteration zeroIteration nextIterationpreviousIteration zeroFrame $fEqSpeed $fShowSpeed $fNumSpeed$fIntegralSpeed $fRealSpeed $fEnumSpeed $fOrdSpeed $fEqFrame $fShowFrame $fNumFrame$fIntegralFrame $fRealFrame $fEnumFrame $fOrdFrame$fShowIteration TerminationNormalTerminationAbnormalTerminationrunAndWaitForTerminationsetupCapabilitiesKeyTimeaddToSystemTimediffSystemTimediffTimeSecToMicrosfloatSecondsToDiffTime addDuration $fEqKeyTime $fOrdKeyTime $fShowKeyTimeshowListOrSingletonreplicateElementsrange randomRsIO commonPrefix commonSuffixclampDiscreteInterpolation interpolateinterpolateSuccessiveSequentiallyInterpolatedListColor8 Background Foreground LayeredColor_colorsBackground_colorsForegroundrgbgrayonBlack whiteOnBlackredgreenblueyellowmagentacyanwhiteblack ColorStringcolored'colored countChars$fMonoidColorString"$fDiscreteInterpolationColorString$fDiscreteDistanceColorString$fIsStringColorString$fShowColorStringHasLayeredColorgetColorSegment HorizontalVerticalObliqueSize_sizeY_sizeXHeightWidthLengthCoords_coordsY_coordsXColRowCoord DirectionUpDownLEFTRIGHTtoCoords maxLength onOuterBordercontainsWithOuterBorder mkSegmentbresenhamLength bresenhamPosSpeed _posSpeedPos_posSpeedSpeedKeyAlphaNumArrowEscapeUnknowngetKeyThenFlushtryGetKeyThenFlush ClearPolicyClearAtEveryFrameClearOnAllocationOnly ResizePolicyMatchTerminalSize FixedSizedefaultResizePolicydefaultClearPolicydefaultClearColordefaultStdoutModepos2vecvec2pos speed2vec vec2speedrotateByQuarterssumVec2d scalarProdparabola"translatedFullCircleFromQuarterArctranslatedFullCirclepolyExtremities LaserReachInfinite LaserPolicyDestroyFirstObstacleDestroyAllObstaclesActual TheoreticalRayLaserRay _laserRayDir _laserRaySegresampleWithExtremities zeroCoords diffCoords sumCoords sumPosSpeeddiffPosToSpeedcoordsForDirectiontranslateInDirchangeSegmentLengthsegmentContains extremities translate translate'movemkSegmentByExtendingWhileCollisionStatus NoCollision PreCollisionLocation InsideWorld OutsideWorld(mirrorSpeedAndMoveToPrecollisionIfNeededfirstCollision Alignment_alignmentKing _alignmentRef AlignmentKind RightAligned LeftAligned mkRightAlign mkCenteredalign' toNextLineDraw drawChar' drawChars'drawTxt'drawStr' drawColorStr'drawAlignedTxt_'drawAlignedTxt'drawAlignedColorStr'RenderrenderToScreen' NaiveDraw$fRenderNaiveDraw$fDrawNaiveDraw drawColorStrdrawAlignedColorStrdrawAlignedTxt_drawAlignedTxtdrawTxtdrawStr drawCharsdrawCharrenderToScreenDeltaEnv newDefaultEnvnewEnvsetResizePolicysetClearPolicy setClearColorsetStdoutBufferModeDrawabledrawDiscreteMorphing drawMorphingdrawMorphingSuccessive Evolution_evolutionSuccessive_evolutionLastFrame_evolutionDuration_evolutionInverseEase EaseClockmkEvolutionEaseQuart mkEvolution mkEaseClockgetDeltaTimeToNextFrame getValueAtdrawMorphingAt ColorabledrawUsingColorDiscreteColorableMorphingdrawMorphingUsingColor RectContainer_rectFrameContentSize_rectFrameUpperLeft($fDiscreteColorableMorphingRectContainer$fDiscreteDistanceRectContainer$fColorableRectContainer$fEqRectContainer$fShowRectContainerColored _coloredColor_coloredColorable$fDiscreteMorphingColored$fDiscreteDistanceColored$fDrawableColored$fHasLayeredColorColored $fShowColored TextAnimation_textAnimationFromTos_textAnimationAnchorsFrom_textAnimationClock AnchorChars AnchorStrings renderAnimatedTextStringAnchoredrenderAnimatedTextCharAnchoredgetAnimatedTextRenderStates(mkSequentialTextTranslationsCharAnchored*mkSequentialTextTranslationsStringAnchoredmkTextTranslation$fShowTextAnimationshootLaserWithOffset shootLaserafterEndcomputeActualLaserShotMVectoraccessUnderlying unstableSortlengthcapacitynewread unsafeReadclearpushBackSTVectorIOVector MVectorData_mVectorDatasize_mVectorDataBufferbres$fDiscreteDistance[]$fDiscreteDistanceIntBack GHC.IORefIORefCell ClearContext OnAllocationOnFrameDeltaBufferBackFrontBufferFrontFloat$fDiscreteInterpolation[]$fDiscreteInterpolationInt3$fDiscreteInterpolationSequentiallyInterpolatedList.$fDiscreteDistanceSequentiallyInterpolatedList Xterm256ColorRGBColor GrayColorRGBcolor8FgSGRToCodecolor8BgSGRToCodebresenhamColor8LengthbresenhamColor8color8CodeToXterm256xterm256ColorToCode grayToRGB$fDiscreteInterpolationColor8$fDiscreteDistanceColor8#$fDiscreteInterpolationLayeredColor$fDiscreteDistanceLayeredColor&approximateGrayComponentAsRGBComponent$grayComponentToFollowingRGBComponentGHC.WordWord8_rgbR_rgbG_rgbB encodeColorsmkColor8insertionColorinterpolateCharssimplifyinterpolateColors$fDiscreteDistanceCoords$fDiscreteInterpolationCoords getAllChars _buffersDelta BufferIndex BufferSizeWord16Policies_policiesResizePolicy_policiesClearPolicy_policiesClearColorBuffers_renderStateBackBuffer_renderStateFrontBuffer_buffersDrawWidth_buffersPoliciesDim getHeight getRowColJustGHC.EnummaxBoundgetIndexexpand expandIndexed mkIndexedCellmkCell clearCell getDimensionsbufferSizeFromWH mkBuffers newContext updateSizeintegrateAcceleration2integrateVelocity GHC.Floatsincos getOverRepIdx resampleRecverifyResampleNothingTrueMirror MirrorRow MirrorCol MirrorAll mirrorSpeedmirrorIfNeededAtomic deltaDrawChardeltaDrawChars deltaDrawStr deltaDrawTxtfillfillBackBuffer clearIfNeeded deltaFlushsetCursorPositionIfNeeded computeDeltasetCursorPositionCode$fRenderDeltaEnv$fDrawDeltaEnvrenderPartialRectContainercountRectContainerChars!countRectContainerHorizontalCharscountRectContainerVerticalCharsmain$fDiscreteDistanceNotWaypoint NotWaypoint BuildFromFromAsFromBsranges UIEvolutions_uiEvolutionContainer_uiEvolutionsUpDown_uiEvolutionLeft UIAnimation_uiAnimationDeadline_uiAnimationProgress isFinished getDeltaTimemkTextAnimRightAligned mkUIAnimationcreateUITextAnimationsmkTextAnimCenteredUpDown_uiAnimationEvsgetUIAnimationDeadlinerenderUIAnimation+exampleOfsequentialTextTranslationsAnchoredexampleDownTranslationDuoExample_exampleInputData_exampleSelfHeight_exampleStartHeight _exampleName_exampleCommentExamples