Îõ³h$;)89*      !"#$%&'()NoneT* worldturtle.Return a valid heading value between (0, 360).+ worldturtle1Return a valid heading value between (-180, 180).,-./0123456789:;<=>?*+ WorldTurtle"(c) Archibald Neil MacDonald, 2020BSD3FortOyer@hotmail.co.uk experimentalPOSIXNone‹ worldturtle×Creates the default turtle polygon arrow with a given outline color and fill color. worldturtleÇDraws a line from a start-point to an end-point with a given thickness. worldturtle Outline color worldturtle Fill color worldturtle Arrow shape. worldturtleStarting point. worldturtle Ending point. worldturtleLine thickness. worldturtleProduced line.None¯ @ABCDEFGHIJKNone–L worldturtle,All pictures that make up the current canvasM worldturtle Stop drawing call for animationsN worldturtle!Remaining available for animatingO worldturtle"ID of next turtle to be generated. worldturtleÄThe Turtle that is drawn on the canvas! Create a new turtle using .P worldturtle5Continuation Monad on top of the State Monad of form SequenceCommand b a. b¬ is the final return type of the entire Monad sequence - this is what will be returned if/when we need to exit early from anywhere in a great big sequence of steps. a÷ is the return type of the current step of the animation sequence. That is: what will be passed into the next step.Q worldturtleState Monad that takes our R type as its state object.S worldturtleÛAlmostVal represents a computation that can "almost" complete. Either There is enough time to solve the computation, or the computation needs to exit early as there is not enough time to fully run the computation.T worldturtleÌGenerates default parameter arguments. The TSC returned by this value must never be used for sequencing as the exitCall is undefined and will only be defined in the setup stage of the animation process.U worldturtle¤Gets the remaining simulation time of the current turtle process. The simulation time dictates how much time is remaining for an animation, and it will be reduced as the animations play in sequence. Once this value hits 0 the exit command will be called and the monad will stop processing.V worldturtle»Sets the simulation time in the state monad. If the simulation time is <= 0 then this setter will immediately call the exit function which will kill any further processing of the monad.W worldturtleÎTakes a value away form the current sim time and store the updated time. See V.X worldturtle-Given a picture, adds it to the picture list.Y worldturtleûNever call an animation directly, always call this instead! This is part of our setup stage to inject the exit call into the animation before running the animation. What is returned by this class is either the completed animation or an early exit. †We take our command and an exit call, and store the exit in the state monad then execute the command. The return value is either a Zà which means the exit was called early or a `Just a` which is the monad successfully completed.[ worldturtle®Runs two items in parallel then applies a semigroup combination operator to the result of both. This combination can only return if both A and B return. Compare to \! which can return if one returns.\ worldturtle2Runs two items in sequence, returns the result of a if a- passes, otherwise returns the results of b€. The implication of this is that only the result of a will be returned while animating, and b when animation is finished.] worldturtleGiven two sequences a and bÕ, instead of running them both as separate animations, run them both in parallel!^ worldturtleãCalls our early exit and fails the callback. No calculations will be performed beyond this call.W worldturtle.Value to subtract from store simulation time. X worldturtlePicture to add to our animationY worldturtleAnimation passed in.[ worldturtle Sequence a to run. worldturtle Sequence b to run. worldturtle$New sequence of A and B in parallel.\ worldturtle Sequence a to run. worldturtle Sequence b to run.] worldturtle Sequence a to run. worldturtle Sequence b to run. worldturtle3New sequence of A and B which returns both results.RPS_`aUVWXbcde[\^None¦ worldturtleA þ represents an instruction to execute. It could be as simple as "draw a line" or more complicated like "draw 300 circles."Ìs can be executed in order by combining them using the monadic operator f.ÄHere is an example of how to write a function that when given a size and a turtle, will return a new ; which will draw a square with a length and breadth of size using turtle. ÿ drawSquare :: Float -> Turtle -> TurtleCommand () drawSquare size t = replicateM_ 4 $ forward size t >> right 90 t 4This draws a square by doing the following in order: (1/4)Move forward by size amount. Turn right by 90 degrees(2/4)Move forward by size amount. Turn right by 90 degrees(3/4)Move forward by size amount. Turn right by 90 degrees(4/4)Move forward by size amount. Turn right by 90 degreesghiThe commands used"(c) Archibald Neil MacDonald, 2020BSD3FortOyer@hotmail.co.uk experimentalPOSIXNoneÔÙ4L( worldturtleCreates a new † and displays it on the canvas. This turtle can then be manipulated! For example, to create a turtle and then move the turtle forward: Ò main:: IO () main = runTurtle $ do t <- makeTurtle forward 90 t ?The default turtle starts at position (0, 0) and is orientated North. worldturtleThis variant of ñ takes a starting position, a starting orientation, and a color to apply to the turtle and the turtle's pen. ± myCommand :: TurtleCommand () myCommand = do t1 <- makeTurtle' (0, 0) 0 green t2 <- makeTurtle' (0, 0) 90 red forward 90 t1 <|> forward 90 t2 See . worldturtle*Move the turtle backward by the specified distance,, in the direction the turtle is headed.  worldturtleShorthand for .  worldturtle0Turn a turtle right by the given degrees amount.  worldturtleShorthand for  .  worldturtle)Move the turtle forward by the specified distance,, in the direction the turtle is headed.  worldturtleShorthand for  . worldturtleÔStamp a copy of the turtle shape onto the canvas at the current turtle position. worldturtle/Turn a turtle left by the given degrees amount. worldturtleShorthand for .j worldturtleÏDraws an arc starting from a given starting point on the edge of the circle. worldturtleDraw an arc with a given radius. The center is radius units left of the turtle if positive. Otherwise radius units right of the turtle if negative.ýThe arc is drawn in an anticlockwise direction if the radius is positive, otherwise, it is drawn in a clockwise direction. worldturtleÉReturns the turtle's current position. Default (starting) position is (0, 0). worldturtle*Warps the turtle to its starting position (0, 0) and resets the orientation to North2 (90 degrees). No line is drawn moving the turtle. worldturtle‹Warps the turtle to a new position. The turtle jumps to this new position with no animation. If the pen is down then a line is drawn. worldturtle Alias of . worldturtleReturns the turtle's heading.07 is along the positive x-axis, going anticlockwise. So:East is 0 degrees. North is 90 degrees.West is 180 degrees. South is 270 degrees.The default heading is North (90 degrees). worldturtleSets the turtle's heading. See . worldturtleÖReturns the turtle's pen color. The color of the turtle's pen.The default color is black. worldturtle"Set the turtle's pen color. See . worldturtle†Returns whether the turtle's pen is down. When the turtle's pen is down it will draw a line when it moves. The default value is true. worldturtle,Sets the turtle's pen to down or up. See . worldturtle.Returns the turtle's pen size. Defaults to 2. worldturtle#Sets the turtle's pen size. See . worldturtle?Returns whether the turtle is visible. The default value is true. worldturtle%Sets the turtle's visibility. See .  worldturtle;Returns whether the turtle's current speed. Speed is is distanceú per second. A speed of 0 is equivalent to no animation being performed and instant drawing. The default value is 200.! worldturtle Sets the turtle's speed. See  ." worldturtle,Gets the turtle's representation as a Gloss k.# worldturtle,Sets the turtle's representation to a Gloss k . See "4. For example, to set the turtle as a red circle: ‚ import Graphics.WorldTurtle import qualified Graphics.Gloss.Data.Picture as G myCommand :: TurtleCommand () myCommand = do t <- makeTurtle setPenColor red t setRepresentation (G.color red $ G.circleSolid 10) t forward 90 t $ worldturtleÇClears all drawings form the canvas. Does not alter any turtle's state.% worldturtle90 degrees.& worldturtle0 degrees.' worldturtle180 degrees.( worldturtle270 degrees.l worldturtle”Looks up the turtle data for the given turtle in the state monad. This type signature comes form GHC...my prism-foo is not good enough to sugar it.m worldturtle€This is a helper function for our getter commands. It takes a default value, the lense to compose, and the turtle to inspect.n worldturtleËThis is a helper function that extracts the turtle data for a given turtle.o worldturtleñThis is a helper function for our setter commands It takes a lens, the value to apply, and the turtle to modify. worldturtleInitial position of the turtle. worldturtleInitial heading of the turtle. worldturtle)Color of the turtle and the turtle's pen. worldturtleThe generated turtle. worldturtleDistance to move the turtle. worldturtleThe turtle to move.  worldturtle#Rotation amount to apply to turtle. worldturtleThe turtle to rotate.p worldturtleStarting point worldturtleDistance worldturtleHeading in degrees. worldturtlecoefficient [0, 1]  worldturtleDistance to move the turtle. worldturtleThe turtle to move. worldturtle'The turtle with the shape to be copied. worldturtle#Rotation amount to apply to turtle. worldturtleThe turtle to rotate.j worldturtle%Point on edge of circle to start from worldturtleRadius of circle worldturtle"Absolute starting angle in degrees worldturtle'Rotation amount about radius in degrees worldturtleLine thickness (penSize) worldturtleColor of circle  worldturtleResulting circleq worldturtlePoint on edge of circle worldturtleRadius of circle worldturtle"Absolute starting angle in degrees worldturtle'Rotation amount about radius in degrees worldturtleResulting new point worldturtleRadius of the circle. worldturtle+Angle to travel in degrees. For example: 360 for a full circle or 180 for a semicircle. worldturtleTurtle to move in a circle. worldturtleTurtle to query. worldturtleReturned current point. worldturtlePosition to warp to. worldturtleTurtle to modify. worldturtleTurtle to query. worldturtle%Returned heading as angle in degrees. worldturtleHeading to apply.  worldturtleTurtle to set. worldturtleTurtle to query. worldturtleReturned current pen color. worldturtleNew pen color to apply worldturtleTurtle to modify. worldturtleTurtle to query. worldturtle"True if pen is down, false if not. worldturtle4New state for pen flag. True for down. False for up. worldturtleTurtle to modify. worldturtleTurtle to query. worldturtleSize of turtle's pen. worldturtleNew size for turtle's pen. worldturtleTurtle to modify. worldturtleTurtle to query. worldturtle'True if turtle is visible,false if not. worldturtleNew state for visible flag. worldturtleTurtle to modify.  worldturtleTurtle to query.! worldturtle New speed. worldturtleTurtle to modify." worldturtleTurtle to query.# worldturtleTurtle to mutate.%  !"#$%&'(%   !" #$&%'( WorldTurtle"(c) Archibald Neil MacDonald, 2020BSD3FortOyer@hotmail.co.uk experimentalPOSIXNone7Ú) worldturtle) takes a 2 and produces the animation in a new window! The simplest way to run )Á is to execute it directly from your main function like so: Æ main :: IO () main = runTurtle yourOwnCoolCommand ÅWhile running, you can interact with the window in the following way:Action InteractionPan the viewport.Click and drag Zoom in/out.Mousewheel up/down'Reset the viewport to initial position.SpacebarReset the animation.R keyPause the animation.P keyQuit Escape keyr worldturtle-Tests to see if a key-event is the reset key.) worldturtleCommand sequence to executeÇstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ  !"#$%&'())  !"#$%&'()*+,-./0123456789:8;<8;=8;>8;?8;@8;A8;B8;C8;D8EF8EG8EH8IJ8IK8IL8IM N OPQ"$&(.R,*STUVWXYZ[\]^_`ab cdefghijklmno pqrs tuvwxyz{8|}8|~8|8|€8|8|‚8|ƒ8|„8|…8|†8|‡8|ˆ8|‰8|Š8|‹8|Œ8|8|Ž8|8|8|‘8|’8|“8|”8|• –— –˜ –™ –š›worldturtle-0.1.0.0-inplaceGraphics.WorldTurtleGraphics.WorldTurtle.CommandsGraphics.WorldTurtle.Shapes$Graphics.WorldTurtle.Internal.Coords$Graphics.WorldTurtle.Internal.Turtle&Graphics.WorldTurtle.Internal.Sequence makeTurtle&Graphics.WorldTurtle.Internal.CommandsbaseGHC.Base<|>Àgloss-renderi_-1.13.1.1-e929f6ea42d15f0fa19cd6261cb94ad2faf1fc82%Graphics.Gloss.Internals.Data.PicturePoint turtleArrow thickLineTurtle TurtleCommand makeTurtle'backwardbkrightrtforwardfdstampleftltcirclepositionhomegoto setPositionheading setHeadingpenColor setPenColorpenDown setPenDownpenSize setPenSizevisible setVisiblespeedsetSpeedrepresentationsetRepresentationclearnortheastwestsouth runTurtlenormalizeHeadingnormalizeDirection7gloss-1.13.1.1-fc280106fa5ec0f92f0dbec1e7d71883aa0e01ddGraphics.Gloss.Data.Point pointInBoxGraphics.Gloss.Data.VectorunitVectorAtAngle normalizeVangleVVrotateVmulSVdetVdotVargVmagVGraphics.Gloss.Geometry.AnglenormalizeAngleradToDegdegToRad$Graphics.Gloss.Data.Point.Arithmetic*negate-+PathVectorlerp TurtleDatascale defaultTurtle drawTurtle_pics _exitCall _totalSimTime _nextTurtleIdSequenceCommand TurtleStateTSC AlmostVal defaultTSCsimTime setSimTimedecrementSimTime addPicture exitCondition GHC.MaybeNothingcombineSequencealternateSequence runParallel failSequencepics totalSimTimeturtles renderTurtlegenerateTurtleanimate'animate>>seqTSeqC drawCircle_Picture turtLens_getter_tData_setter_calculateNewPointF_calculateNewPointC_ isResetKey_Graphics.Gloss.Data.Colororange chartreuse aquamarineazurevioletrosemagentacyanyellowbluegreenredwhiteblackgreyN withAlphawithBlue withGreenwithReddarklightbrightdim addColors mixColors#Graphics.Gloss.Internals.Data.ColorColor makeColor makeColorI rgbaOfColor