6,      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ None7A complete Processing script. 5It consists in several parts, most of them optional.  $(: Usually the place where variables are  initialized.  "*: After running the code in the preamble, + the code in this part is executed once.   ,: After the setup, this part of the code is * executed in loops over and over again.  &: Each time the user clicks, the code  here is executed once. +To generate each part of the code, use the ProcM monad  and the functions from the !Graphics.Web.Processing.Interface  module. Then, run runProcM or  execProcM to get the  code result. *Class of reducible types. Values of these ) types contain expressions that can be  reducible.  class for Proc_* values.  class for Proc_* values. !Class of Processing value types (Proc_* types). Proc_*/ types are types from the world of Processing. 3 Some of them are similar to Haskell types, like   and . However, they are not equal. Proc_* types  are instance of /. However, you should instead use methods from  analog   class. Proc_*# types contain expressions instead  of values. Think of 2+2 instead of 4. Under this situation,  2+2 /= 3+15, since they are different expressions, even if they 6 evaluate to the same value. Actually, you will get   from the evaluation of  2+2 == 3+1, since the library is smart A enough to figure out they are the same value. But, please, don't  rely on this. Use the   and  classes instead. 9 They return Processing boolean expressions instead of  values. A Anyway, the types of the library will try to force you to use Proc_*  types everywhere. EThe reason this library stores expressions instead of values is that " it needs to handle things like 2+x, where x is an unknown value. H However, an effort is done to ensure that each expression is reduced  to its minimum extension. 'Create a variable assignment, provided 4 the name of the variable and the value to asign. "Create an argument for a command. Variable reading. Conditional value. Type of variables. Get the name of a variable.  Assigments. A command argument. A piece of Processing code. ) The type parameter indicates what the  context of the code is. ' This context will allow or disallow  the use of certain commands. Type of keyboard key codes. Type of keyboard keys. Type of textual values. Type of characters. Type of images. Floating point numbers.  The provided % instance checks the equality of the ' internal expression, not the value. Integer numbers. Boolean values. %Code executed when a key is pressed. 2Code that is executed when the mouse is released. 1Code that is executed when the mouse is clicked. The drawing loop. "In the setup part, settings like size or   frame rate are supplied. $The preamble is the code that is executed # at the beginning of the script. & Value of . ' Value of . ( Negation. ) Disjunction. * Conjunction. +Cast a  value. ,Cast an  value. -Calculates the  of a . Float recursion+. Applies a function to the subexpressions  of a . .Cast a  value. Noise random function. /Cast a  to a . 0Cast a  value. 1Cast a strict  value. Code for commands. Code for assignments. Code for variable creation. Code for comments. Code for conditionals. )Sequence to pieces of code with the same - context type. This way, code that belongs * to different parts of the program will  never get mixed. An empty piece of code. DReturns the name of the type (processing version) in an assignment. 'Internal function to create variables. 2Empty script.  WARNING: , , ,  and   methods are undefined.  WARNING:  method is undefined.  WARNING:  method is undefined.        !"#$%&'()*+, !"#$%-./01234567&'()*+,-./01Name of the command.  Arguments.  Code result.  Assignment.  Code result. Initial assignment.  Code result. 892:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd  !"#$%&'() !"#$%&'()*+,-./012k       )('&%$#"! *+, !"#$%-./01234567&'()*+,-./01892:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd None3:Types in this instance form a monad when they are applied  to a context c*. Then, they are used to write Processing  code. e;Internal function to process commands in the target monad. f=Internal function to process asignments in the target monad. gEInternal function to process variable creations in the target monad. 4Write a comment in the code. 5Conditional execution. hLift a 6 computation. 6.Processing script producer monad. The context c indicates the context  of the underlying ,. This context restricts the use of certain 4 commands only to places where they are expected. EThe commands that you can run under this monad are mostly defined in  !Graphics.Web.Processing.Interface. -Once you have all the commands you want, use 7 or 8 ; to generate the corresponding Processing code under the  type. 7#Generate Processing code using the 6 monad.  The code output is reduced. iRun a 6) computation with an initial var number. > It also applies a reduction to the output Processing code. 8#Generate Processing code using the 6 monad, discarding the final  value.  execProcM = snd . runProcM jAdds 11 to the variable counter and returns the result. k!Get the current variable number. l!Set the current variable number. 3efg45 Condition.  Execution when the condition is &.  Execution when the condition is '. h6mn7i8jklopqr3efg45h67i8jkl 3efg45h6mn7i8jklopqrNone9-Create a new variable with a starting value. 2 The creation of variables is restricted to the  $. :Read a variable.  Funny fact: 1it does not matter when you execute this function.  The result will always. hold the last value asigned to the variable.  For example, this code   v <- newVar 10  ten <- readVar v  writeVar v 20  point (10,ten) will draw a point at (10,20). ;Write a value to a variable. s9:;9:;9:;s9:;None*<Special keys. BKey modifiers. F Arrow keys. K(Keyboard keys recognized by Processing. P-A point as a pair of floating point numbers. Q$RGBA colors. Values must be between . 0 and 255, including in the alpha channel. S Red channel. TBlue channel. UGreen channel. VAlpha channel (opacity). & 0 means transparent, and 255 opaque. W3Class of contexts where the user can draw pictures  in the screen. Instances:  "        XWidth of the canvas. YHeight of the canvas. Z4Frames since the beginning of the script execution. [)Approximate number of frames per second. \Noise random function. ]Set the drawing color. ^Set the filling color. _$Fill the screen with a given color. `Set the weight of the lines. aDraw a ellipse. bDraw a circle. c Draw an arc. 2The arc is drawn following the line of an ellipse  between two angles. d Draw a line. ePrints a dot. f1A quad is a quadrilateral, a four sided polygon. 3 The first parameter is the first vertex and the 5 subsequent parameters should proceed clockwise or / counter-clockwise around the defined shape. g2Draws a rectangle to the screen. A rectangle is a 8 four-sided shape with every angle at ninety degrees. - The first parameter set the location, the 9 second sets the width, and the third sets the height. h:A triangle is a plane created by connecting three points. iBzier curve. t#Begin shape command. Not exported. u!End shape command. Not exported. vVertex command. Not exported. jPolygon drawer. kDisplay a text in the screen.  The color is specified by ^. l5Apply a rotation to the following pictures, centered  at the current position. m4Apply a scaling to the following pictures, centered  at the current position. nMove the current position. o!Reset the transformation matrix. p/Get the current position of the mouse pointer. q'This function takes a variable of type  and a K, and sets the variable to  &! if the key pressed is the given K$. Otherwise, the variable is set to '. rSet the size of the canvas. s;Specify the number of frames to be displayed every second. - The default rate is 60 frames per second. A<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\w]^_`aCenter of the ellipse. Width of the ellipse. Height of the ellipse. bCenter of the circle. Radius. cCenter of the ellipse. Width of the ellipse. Height of the ellipse. Initial angle (in radians). End angle (in radians). dStarting point.  End point. eLocation of the point. fgLocation of the rectangle. Width of the rectangle. Height of the rectangle. hiInitial point. First control point. Second control point.  End point. tuvjkText to draw.  Position. Width. Height. lmHorizontal scaling. Vertical scaling. nHorizontal displacement. Vertical displacement. opxqrsyz{|;345<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs;XY\WQRSTUV]^_`PabcdefghijkrsnlmopKONMLFJIHGBEDC<A@?>=qZ[345,<A@?>=BEDCFJIHGKONMLPQRSTUVWXYZ[\w]^_`abcdefghituvjklmnopxqrsyz{|None}-Number of operations needed to calculate the  value of a given  value. ~,Number that indicates the maximum number of  operations allowed for a  calculation  to consider it cheap. ,Number of times an expression is considered & repeated enough to be substituted.  Check if a  calculation is expensive,  depending on ~.  Check if a  calculation is cheap,  depending on ~. Add a  to the  float counter. #Add each expression contained in a  to the   float counter. 1Most frequent expensive expression within a list  of expressions.  It returns  when no expensive expression 3 was found, or they are not repeated enough (see ). 8 If there are more than one most frequent expression,  it returns one of them. Apply a substitution. 3From a list of arguments, create a sequence of the  arguments of type  (which may be empty). 5Gather all the float expressions in a piece of code. Like ", but applied to a piece of code.  Assign a substitution variable a expression, 2 and use that variable in the rest of the code. -Apply a substitution to a floating argument. ( To other arguments, it does nothing. )Apply a substitution to a piece of code. tLOptimization by substitution. It looks for commonly repeated operations and ? create variables for them so they are only calculated once. 6This optimization is applied automatically when using  execScriptM. )}~Origin. Target.  Expression. Result. Index. Optimization variable name. Substitution variable index. Expressions to be substituted. Original code. Assignment and result code. Origin. Target. Original argument. Result argument. Origin. Target. Original code.  Result code. ttt%}~tNoneuRender a script as a lazy . vRender a script using u and  write it directly in a file. wConditional value. uvw4  !"#$%&'()*+,-./012uvw42uv$%"# !&'+()*,/.-01  wuvwNonew  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsuvw678None x8Class of monads where variables can be set in a natural  way (similar to IORef"). Instances of this class behave ? in a proper way, without the weird behavior of the original  :. y-Create a new variable with a starting value. zRead a variable. {!Write a new value to a variable. |IContext of an event. The context determines which functions can be used.  $ is not an instance of | to avoid using $ as  an event (see ). }@Scripter monad. This monad is where Processing code is written. + Because of some implementation details, } has a context c.  However, this context is always $. ~Monad of events. Use ! to insert an event in a script (}). 1 To write the event code, use the functions in  &Graphics.Web.Processing.Core.Interface, since ~ is an instance  of 3. Plain empty event state. ESet an event. Different events are specified by the instances of the  | class. )For example, the following code sets the ^' pattern in the setup event (the event ; that is called once at the beginning of the execution). # on Setup $ fill $ Color 0 0 0 255 >Execute the scripter monad to get the full Processing script.  Use u or v to render it. :After generating the script, the output code is optimized  using t. Magic! Keep it private, it's our secret! Magic! Keep it private, it's our secret! /xyz{|}~z  !"#$%&'()*+,-./012345<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsuvwxyz{|}~ |~}xyz{xyz{|}~ Nonez  !"#$%&'()*+,-./012345<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrsuvwxyz{|}~None2Typeclass of values that can be stored in several  native variables (). /Calculate how many native variables are needed  to store a value. ETypeclass of custom values, which can be stored in custom variables ().  Version of y for custom variables.  Version of z for custom variables.  Version of { for custom variables. Variable with custom values. +"None2SimpleEventM monad: EventM with a state attached. The monoid of plane figures. List of figures. -Scale a figure by the given x and y factors. /Rotate a figure by the given angle in radians. 1Translate a figure in the direction of a vector. #Set the filling color of a figure.  Set the line color of a figure. Text. 7Bezier curve. First and last arguments are the initial 5 and end points of the curve. The other points are  control points. +Rectangle such that the top-left corner is - at the specified point, and its width and 4 height are specified by the other two arguments. ,Arc. The arc is drawn following the line of " an ellipse between two angles. 4 The first argument is the center of the ellipse. 6 The next two arguments are the width and height of  the ellipse. 2 The last two arguments are the initial and end  angles of the arc. ,Circle centered at the given point and with  the specified radius. %Ellipse centered at the given point, ) with width and height also specified.  Polygon given a list of vertex. Line joining a list of points. !A path is just a list of points. )Adjust a point so x coordinates increase . to the right and y coordinates to the top. ,Display a figure using a Processing script. %Create a Processing animation from a -valued function. )Framework to create interactive scripts. 9Note that is required for the state to be an instance of . 1 More info on how to instantiate a type in the  class in the  %Graphics.Web.Processing.Mid.CustomVar module. #0Width (if none, takes as much as is available). 1Height (if none, takes as much as is available). Background color. Figure to display. 0Width (if none, takes as much as is available). 1Height (if none, takes as much as is available).  Frame rate. Background color. 1Function to produce the next frame of animation, # given the current frame number. 0Width (if none, takes as much as is available). 1Height (if none, takes as much as is available).  Frame rate. Initial state. How to print the state. 2Background color, depending on the current state. *Function to step the world one iteration. . It is passed the number of frames from the  beginning. 0Function called each time the mouse is clicked. 8Key events. List of pairs, where the first component is  a K2 and the second component is the reaction to that  K.        !"#$%&'()*+,-./012<=>?@ABCDEFGHIJKLMNOPQRSTUVuvw.QRSTUVPKONMLFJIHGBEDC<A@?>= None>Create a canvas element which contain a Processing animation. ( The output is of the following form: < <canvas data-processing-sources="specified path"></canvas> #Create the following HTML element:  ( <script src="specified path"></script> Use it to import the  processing.js script,  inside the head tag. =Default template for visualizing Processing scripts in HTML. ?Write a Processing script and the HTML default template for it  to files, using v and . File path to the script. Location of the  processing.js script. Where to find the  processing.js module. *File name for the Processing script (with .pde extension).  Html title.  Html output. Where to find the  processing.js module. +Where to write the Processing script (with .pde extension).  Html title. #Where to write the HTML file (with .html extension). Processing script.                       ! " # $ % & & ' ' ( ( ) ) * * + + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = >?@ABCDEFGHIJKLMNOPQRLBSTUUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{?@A|}~                                                 !                     #          $               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ 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 [ \ ] ^ _ ` a b c d e f g h i j k l m n o < p q r s tuvwxyz{|}~}~        processing-1.0.1.0"Graphics.Web.Processing.Core.Types Graphics.Web.Processing.Core.Var&Graphics.Web.Processing.Core.InterfaceGraphics.Web.Processing.Basic Graphics.Web.Processing.OptimizeGraphics.Web.Processing.Mid%Graphics.Web.Processing.Mid.CustomVarGraphics.Web.Processing.SimpleGraphics.Web.Processing.Html#Graphics.Web.Processing.Core.Primal"Graphics.Web.Processing.Core.MonadGraphics.Web.Processing ProcScript proc_preamble proc_setup proc_drawproc_mouseClickedproc_mouseReleasedproc_keyPressedProc_Ord#<=#<#>=#>Proc_Eq#==#/=ProcTypeVarvarNameProcCode Proc_Text Proc_Char Proc_Image Proc_FloatProc_Int Proc_Bool KeyPressed MouseReleased MouseClickedDrawSetupPreambletruefalsepnot#||#&&fromBoolfromIntpfloor fromFloat intToFloatfromChar fromStText emptyScript ProcMonad writeCommentiffProcMrunProcM execProcMnewVarreadVarwriteVar SpecialKeyESCRETURNENTERTAB BACKSPACE KeyModifierSHIFTCONTROLALTArrowKeyRIGHTLEFTDOWNUPKeyModKeyCharKey Proc_PointColorredcbluecgreencalphacDrawing screenWidth screenHeight frameCount getFrameRatenoisestrokefill background strokeWeightellipsecirclearclinepointquadrecttrianglebezierpolygondrawtextrotatescale translate resetMatrix getMousePointmatchKeysize setFrameRateoptimizeBySubstitution renderScript renderFileif_ ProcVarMonadContextScriptMEventMon execScriptM VarLength varLength CustomValuenewVarCreadVarC writeVarC CustomVarFigureFiguresScaleRotate Translate FillColor LineColorTextBezier RectangleArcCircleEllipsePolygonLinePath displayFigure animateFigureinteractiveFigure procCanvas importScript defaultHtml writeHtml Reducibleghc-prim GHC.ClassesOrdEq GHC.TypesBoolTrue proc_asignproc_arg proc_read proc_cond ProcAsignProcArg Proc_KeyCodeProc_KeyFalseIntbaseGHC.RealfloorrecFloatFloatnoisefChar text-0.11.3.1Data.Text.Internalcommand assignment createVarcomment conditional>>. emptyCodeptype varFromText$fFloatingProc_Float GHC.Floatsinhcoshasinhacoshatanh$fNumProc_FloatGHC.Numsignum $fNumProc_Intreduce CharAsign TextAsign ImageAsign FloatAsignIntAsign BoolAsignCharArgTextArgImageArgFloatArgIntArgBoolArgSequenceComment Conditional Assignment CreateVarCommandKeyCode_DELETE KeyCode_ESCKeyCode_RETURN KeyCode_ENTER KeyCode_TABKeyCode_BACKSPACE KeyCode_SHIFTKeyCode_CONTROL KeyCode_ALT KeyCode_RIGHT KeyCode_LEFT KeyCode_DOWN KeyCode_UP KeyCode_VarKey_Char Key_CODEDKey_Var Text_CondText_Var Char_CondChar_Var Image_Cond Image_Var Float_Cond Float_Noise Float_FloorFloat_ArctangentFloat_Arccosine Float_Arcsine Float_Cosine Float_Sine Float_Log Float_Sqrt Float_Exp Float_Abs Float_Var Float_Mod Float_Mult Float_DivideFloat_Substract Float_SumInt_Cond Int_FloorInt_AbsInt_VarInt_ModInt_Mult Int_Divide Int_SubstractInt_Sum Bool_Cond KeyCode_EqKey_EqText_EqChar_NEqChar_EqFloat_GFloat_GEFloat_LFloat_LE Float_NEqFloat_EqInt_GInt_GEInt_LInt_LEInt_NEqInt_EqBool_NEqBool_EqBool_VarProc_AndProc_OrProc_Neg Proc_False Proc_TrueExtendedextendpatmatch pfunctionextendfextendopdocEqdocNEqdocLEdocLdocGEdocGdocCond indentLeveliteratedReducereduceProcPairpvoid$fPrettyProcScript$fReducibleProcCode$fReducibleProcArg$fReducibleProc_Float$fProc_OrdProc_Float$fProc_OrdProc_Int$fProc_EqProc_KeyCode$fProc_EqProc_Key$fProc_EqProc_Text$fProc_EqProc_Char$fProc_EqProc_Float$fProc_EqProc_Int$fProc_EqProc_Bool$fProcTypeProc_Text$fProcTypeProc_Char$fProcTypeProc_Image$fProcTypeProc_Float$fProcTypeProc_Int$fProcTypeProc_Bool$fPrettyProcAsign$fPrettyProcArg$fMonoidProcCode$fPrettyProcCode$fPrettyProc_KeyCode$fPrettyProc_Key$fIsStringProc_Text$fPrettyProc_Text$fExtendedTextProc_Text$fPrettyProc_Char$fExtendedCharProc_Char$fPrettyProc_Image$fFractionalProc_Float$fPrettyProc_Float$fExtendedFloatProc_Float$fIntegralProc_Int$fRealProc_Int$fEnumProc_Int $fOrdProc_Int$fPrettyProc_Int$fExtendedIntProc_Int$fPrettyProc_Bool$fExtendedBoolProc_BoolcommandMassignM createVarMliftProc runProcMWith newVarNumber getVarNumber setVarNumberunProcM$fProcMonadProcM $fMonadProcM$fApplicativeProcM$fFunctorProcM intVarName beginShapeendShapevertex colorArgskeySplit$fDrawingMouseReleased$fDrawingMouseClicked $fDrawingDraw$fDrawingSetupnumOps limitNumber occurNumber isExpensiveisCheapaddFloat browseFloatmostFreq Data.MaybeNothing floatsubs getFloatArgs floatsInCode mostFreqCode varForExpargsubscodesubsSubsM SubsState codeWritten codeStacksubstitutionIndex FloatCounterFloatSetboolops execCounter optVarNamesubstitutionOversubstitutionOverAuxaddSubsCommentssubsPrevCommentsubsPostComment addToStack addToWrittensetIndex resetStackapplySubstitutioncodeSubstitutionrunSubstitution subsOptimize subsCommentData.Text.Lazy.Internal charsPerLineemptyEventState switchContextswitchContextEaddEvent unScriptM ScriptState script_code script_setup script_drawscript_mouseClickedscript_mouseReleasedscript_keyPressedunEventM EventStateevent_preamble event_codeaddCodeaddPCodeemptyScriptState$fProcVarMonadEventM$fProcVarMonadScriptM$fContextKeyPressed$fContextMouseReleased$fContextMouseClicked $fContextDraw$fContextSetup$fProcMonadScriptM$fMonadScriptM$fApplicativeScriptM$fFunctorScriptM$fProcMonadEventM $fMonadEventM$fApplicativeEventM$fFunctorEventM GCustomValuegnewVarC greadVarC gwriteVarC GVarLength gvarLengthfromVar fromCustomVarvarDropcastCVar$fCustomValue(,,)$fVarLength(,,)$fCustomValue(,)$fVarLength(,)$fGCustomValueK1$fGCustomValueM1$fGCustomValue:+:$fGCustomValue:*:$fGVarLengthK1$fGVarLengthM1$fGVarLength:+:$fGVarLength:*:$fGVarLengthU1$fVarLengthProc_Char$fVarLengthProc_Image$fVarLengthProc_Text$fVarLengthProc_Float$fVarLengthProc_Int$fVarLengthProc_Bool$fCustomValueProc_Char$fCustomValueProc_Image$fCustomValueProc_Text$fCustomValueProc_Float$fCustomValueProc_Int$fCustomValueProc_Bool SimpleEventM adjustPointSettingscurrentLineColorcurrentFillColorpairListdefaultSettings setLineColor getLineColor setFillColor getFillColor figureSEvent figureEventkeyEvent$fMonoidFigure Data.Monoid<>mconcatmappendmemptyMonoidgetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductgetFirstFirstgetLastLast