>6U      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<= > ? @ 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 t u v w xyz{|}~                                                                                                                                                           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCD E F G H I J!K!L!M!N!O!P!Q!R!S!T!#UV9Set the X Window cursor for a window to a specified type W  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  %123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~)('&" $#!+0,.-/*" XYZ[\]^_`aX]^_`aX]^_`a /The class of types that can be pretty-printed. 1 (Unfortunately this is not very useful, because C and Expr can be pretty Haskell or pretty Python or pretty Scheme, 0 leading to overlapping instance declarations.) 1pretty x is a pretty String representation of x. F prettyList prefix infix postfix xs is a pretty String representation C of the list xs, with prefix, infix, and postfix specifying the 0 punctuation. For example, if (pretty x) => x,  then prettyList [ ,  ] [x, x, x] =>  [x, x, x]. 0Minimal complete implementation: define pretty.    Indent a single line n spaces.  (sepLines is like unlines, but omits the n at the end of the  last line.  .sepLines2 is like sepLines, but adds an extra n between each  pair of lines so they are double spaced. -Separate strings by commas and nothing else (,) 'Separate strings by commas and spaces (, ) !Separate strings by just spaces ( )                    3Enclose in parentheses, like a Lisp function call.  Example: par foo [x, y] =  (foo x y) +Write a list of words, separated by spaces /Write a list of words, not separated by spaces ;Signal an error using a list of strings to be concatenated ;Signal an error using a list of strings to be concatenated  with spaces between (unwords).  (Generalization of map to lists of lists !)Generalization of mapM to lists of lists ".Insert an item into a list of lists of items, 0 making it the last element in the last sublist #>Insert an item in a list of items, making it the last element $6Update a value at a given key by applying a function.  Similar to Data.Map.adjust. %'Monadic generalization of adjustAList  !"#$% !$%"# !"#$%&bctext for the expander button d*use the root to add rpanel to a container eids of widgets added, in rows fframe, same as root g expander hvbox to contain the rows i"next element goes here if it fits jfree width in current row kmaximum row width lhorizontal padding m'()*+>Given a list of (name, widget) pairs, add each of the widgets  and its name to the rpanel ,(Add a single named widget to the RPanel -$Force the RPanel to begin a new row .CGiven a list of lists, each sublist representing a row of widgets, = add the widgets to the RPanel, preserving the row structure  as much as possible. A (Row structure will be broken if any intended row is too wide.) n#Add a row of widgets to an RPanel. 8 This does not start a new row before the first widget, C but after the last, so at the end, the current row will be empty. &'()*+,-. &*'(),+-. &'()*+,-./o012%Show a message and a set of choices; 6 run the action corresponding to the selected choice;  you might want to include a Cancel# option with the action return (). 9 There *should* be as many actions as there are options. p3Where to put a dialog window.  Possible values are 9 WinPosNone WinPosCenter WinPosMouse WinPosCenterAlways  WinPosCenterOnParent 4,Customizable framework for running a dialog 5q6789:;r<&Add a labeled text entry to the vbox. /0123456789:;<123546789/0:;</0123456789:;< *=3A Translate is a thing that can be repositioned by  delta x and delta y >delta X delta Y thing in old position thing in new position ?@8Make an object have at least a specified minimum width;  does nothing if it's already at least that wide A5BBox x y width height; (x, y) is the top left corner BCDEFGHIJKLMNOPQRSTUBBox accessors and utilities VWXYZ[\]^_`abcd*Form a new BBox which encloses two bboxes ef*=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdef*KLMNOPQRGHIJSCDEFABTUV[WXYbcZ\]^_`adef?@=>*=>>?@@ABBCDEFDEFGHIJHIJKLMNLMNOPQRSTUVWXYZ[\]^_`abcdef g@A Number represents a real number, which can be exact (Integer)  or inexact (Double). hijTell whether a Number is exact k2Take a number, which may be exact or inexact, and - produce the inexact number which equals it. 2 Note that there is no inverse function toExact, J because some inexact numbers like 3.5 are not equal to any exact number. E The class RealFrac provides methods round, ceiling, floor, truncate " for converting to exact numbers. st'Unary operations fall into two groups: + exactOp1 works only for an exact operand; 4 it is an error if the operand is inexact. & The result is always exact.  (Unused) 3 inexactOp1 works directly for an inexact operand; C otherwise by conversion of its exact operand to inexact; ( the result is always inexact. 6 eitherOp1 works for either exact or inexact operand, G and the result is exact if and only if the operand is exact. uvw$Binary operations fall in 3 groups: 9 exactOp2 is implemented only for exact, exact operands;  if there's any inexact operand, it' s an error. < Integer division operations (quot, rem, div, mod) 6 are like this. The result is always exact. = eitherOp2 is implemented directly for exact, exact operands ; and inexact, inexact operands; if one operand is 9 exact and the other inexact, the exact operand ? is converted to inexact. Most arithmetic operations H (+, -, *) are like this. The result may be exact or inexact. C inexactop2 is directly implemented for inexact, inexact operands, C but handles exact operands by converting them to inexact < (even if both are exact). Math functions such as = exp, log, sqrt, and sin are like this. The result  is always inexact. xylmnopzJNumbers are Floating, i.e., support exponential, log, and trig functions. ; This works directly for inexact Numbers, and otherwise by # conversion from Exact to Inexact. {?Numbers are Fractional, i.e., support division and conversion  from Rational. ; This works directly for inexact Numbers, and otherwise by # conversion from Exact to Inexact. |CNumbers are Integral, i.e., can do integer division and convert to F Integer. However, there is a restriction: this only works for Exact / numbers; for Inexact, there will be an error. H Some may see this as regrettable, but how is it different in principle  from division, which doesn't work for zero divisors, and  square root, which doesn't work for negative numbers? };In Haskell both Intgeger and Double are instances of Enum, D so Number should be an instance too. Also, this is a prerequisite # of being an instance of Integral. ~5Numbers are Real, i.e., can be converted to Rational Number as an instance of Num Number as an ordered type 3This Show instance will not be compatible with the + derived Read instance above -- so fix it. E (And yet, mysteriously, ghci accepts 1 and 1.0 as Number literals.) ghijklmnop gihjklmnop gihhijklmnop qrs;class Repr: representable by a String or a list of Strings (repr x is a String representation of x.  reprl x is a [String] representation of x, 9 where the first element should be the same as repr x, . and the rest provide auxiliary information % that you want to be shown with x. 7 reprs x is a reduction of reprl x to a single String. H reprList prefix infix postfix xs is the representation of a list of xs ?Minimal complete implementation: define repr, or define reprl. : The normal way is to define repr. Define reprl instead, ? if for some reason you want to include additional information ; such as the value of an expression in an expression node.  Examples:  - (3 :: Int) has repr => 3 , reprl => [3] , reprs => 3 2 - In Sifflet.Language.Expr, (ENode (NSymbol x) (EvalOk (3 :: Int)  has reprl => [x, 3] , reprs => x 3, and repr => x.  - reprList (   ) [3 :: Int, 4, 5] => (3 4 5) tuvwqrstuvwstuvwqrqrrstuvwtuvw xyz{|}~qrstuvwxyz{|}~xyz{|stuvwqr}~ xyz{|}~ @An Environment contains variable bindings and may be linked to  a next environment FPerhaps it may also be used to generate Vp type variables (with int id's) <A function may have a name and always has an implementation =A collection of functions, typically to be saved or exported  or read from a file EXPRESSION TREES < For pure Sifflet, so not defined for extended expressions. 3Operator grouping: left to right or right to left,  or perhaps not at all -Operator priority, normally is > 0 or >= 0, , but does that really matter? I think not. An operator, such as * or + D An operator is associative, like +, if (a + b) + c == a + (b + c). E Its grouping is left to right if (a op b op c) means (a op b) op c; 5 right to left if (a op b op c) means a op (b op c). % Most operators group left to right.  associative? A more highly parsed type of expression I'Gve restricted function calls to the case where the function expression A is just a symbol, since otherwise it will be hard to visualize. 9 But with some thought, it may be possible to generalize  this to  ECall [Expr] -- (function:args) A The constructors EOp and EGroup are not used in Sifflet itself, K but they are needed for export to Python, Haskell, and similar languages; ? they allow a distinction between operators and functions, and & wrapping expressions in parentheses. 9 EGroup e represents parentheses used for grouping: (e); 6 it is not used for other cases of parentheses, e.g., - around the argument list in a function call.] grouping parentheses binary operator application function name, arglist if test branch1 branch2 4Transform a numerical expression into its negation,  e.g., 5 --> (-5). , Fails if the expression is not an ENumber.  An Expr is extended& if it uses the extended constructors > EOp or EGroup. In pure Sifflet, no extended Exprs are used. JIs an Expr a literal? A literal is a boolean, character, number, string, E or list of literals. We (should) only allow user input expressions  to be literal expressions. Is an expression atomic? H Atomic expressions do not need parentheses in any reasonable language, < because there is nothing to be grouped (symbols, literals) 5 or in the case of lists, they already have brackets + which separate them from their neighbors. 5All lists are atomic, even if they are not literals, 1 because (for example) we can remove parentheses  from ([a + b, 7]) Compound = non-atomic  Example:  ePlus_2_3 = eCall + [eInt 2, eInt 3] 3Convert an expression tree (back) to an expression F It will not give back the *same* expression in the case of an EList. 4The value of an expression in the base environment. 9Convert a literal expression to the value it represents. 2 It is an error if the expression is non-literal.  See exprIsLiteral. &Try to match a single type and value, < may result in binding a type variable in a new environment  or just the old environment Determine the type of a value.  May result in a type variable. FCheck whether the values agree with the types (which may be abstract) >This is *probably* too lenient in the case of type variables:  it can pass a mixed-type list. =Type type of a function, a tuple of (arg types, result type) 7Insert names and values from lists into an environment 0Get the value of a variable from an environment -List of all symbols bound in the environment :List of all symbols bound to functions in the environment %All the functions in the environment 0Return to the environment prior to an extendEnv ;Apply a function fvalue to a list of actual arguments args ? in an environment env and with a limited stack size stacksize      9Integer div and mod operations, for exact integers only. 9 Using an inexact (floating point) argument is an error,  even if the argument is equal to an integer (e.g., 5.0). , Division (div or mod) by zero is an error. Floating point division. 2 Integer arguments are coerced to floating point, * and the result is always floating point.  operands are ints.  x /7 0 is NaN if x == 0, Infinity if x > 0, -Infinity if x < 0. APrimitive function with 2 number arguments yield an number value 8 fn = Number function to implement for Number operands. +Primitive unary functions number to number ;Given an expression, return the list of names of variables  occurring n the expression 9exprVarNames expr returns the names of variables in expr C that are UNBOUND in the base environment. This may not be ideal,  but it' s a start. =decideTypes tries to find the argument types and return type 8 of an expression considered as the body of a function, 9 at the same time checking for consistency of inputs and . outputs between the parts of the expression. 8 It returns Right (argtypes, returntype) if successful;  Left errormessage otherwise. @We need to be able to say functions are equal (or not) in order D to tell if environments are equal or not, in order to know whether @ there are unsaved changes. This is tricky since the primitive 9 function implementations do not instantiate Eq, so if it's 8 primitive == primitive? we go by the names alone (there' s nothing 9 else to go by). Otherwise all the parts must be equal.                  $6grossProfit salesA salesB = 0.12 salesA + 0.25 salesB $bonus1 profit = if profit > 100000 / then 1000 + 0.0012 * profit  else 0 :bonus2 salesA salesB = bonus1 (grossProfit salesA salesB) foo a b = 2 * a + b )An expression representing a call to foo !max x y = if x > y then x else y )An expression representing a call to max 2fact n = if n == 0 then 1 else n * (fact (n - 1)) *An expression representing a call to fact sum of the integers 0..n C Lewis and Loftus, Jave Software Solutions, 6th. ed. (they call it sum) +rmul: multiplication by repeated addition.  The multiply function in Hanly and Koffman,  'Problem Solving and Program Design in C , 5th ed. *An expression representing a call to rmul Even and odd, the slow way. @ Springer and Friedman, Scheme and the Art of Programming (??). 4 Rubio-Sanchez, Urquiza-Fuentes, and Pareja-Flores,  )A Gentle Introduction to Mutual Recursion, > in ITiCSE 2008: The 13th SIGCSE Conference on Innovation and 1 Technology in Computer Science Education, 2008. +Fibonacci series through mutual recursion. 4 Rubio-Sanchez, Urquiza-Fuentes, and Pareja-Flores, Gentle Introduction ;This function will be in error if the function name is not  found in exampleEnv.  =The type of a function to export (user) functions to a file. *Simplify an expression by applying rules $ top-down throughout the expression / tree and repeatedly until there is no change. 2 This is intended for removing extra parentheses, 6 but could be used for other forms of simplification. @Should each rule also know the level in the original expr tree,  with 0 = top level (root)? * That would require additional arguments. CRepeatedly apply a function to an object until there is no change, A that is, until reaching a fixed point of the function, a point  where f x == x.  *Common rules for simplifying parentheses.  Remove ()'.s around a higher precedence operator: e.g.,  (a * b) + c ==> a * b + c  a + (b * c) ==> a + b * c ! Remove ()'-s around an atomic expression -- a variable,  literal, or list " Remove ()'"s in the case of (a op1 b) op2 c, . if op1 and op2 have the same precedence, and ! both group left to right, since 2 left to right evaluation makes them unnecessary. # Remove ()'s in the case of a op (b op c) + if op groups right to left, and note that + it is the same operator op in both places  (though I don'*t know if that restriction is necessary). . This applies to (:) in Haskell, for example:  x : y : zs == x : (y : zs) $%&'4A list of common rules for simplifying expressions. 2 Does *not* include ruleIfRight, since that works  for Haskell but not Python. (ATry the first rule in a list to see if it changes an expression, H returning the new expression if it does; otherwise, try the next rule, K and so on; if no rule changes the expression, then return the expression. 7 (Note that (applyFirstMatch rules) is itself a rule.) 6Apply a rule top-down to all levels of an expression.  Normally, the rule. would be a value of (applyFirstMatch rules).  !"#$%&'(  !"$&'%#(  !"#$%&'(),A Haskell function or variable declaration. + An explicit type declaration is optional.  Thus we have just enough for  name :: type  name [args] = expr.  Of course [args] would be empty if it's just a variable. *+,-./>A Haskell modules import decls: a list of module identifiers.  No support for  qualified or as or for selecting only some ( identifiers from the imported modules. 01A Haskell module''s export spec: a list of function and  variable identifiers 23;A Haskell module; moduleDecls are functions and variables. 456789:;Wrap a string in parentheses <The Haskell operators. * Now what about the associativity of (:)?  It really doesn'#t even make sense to ask if (:) is " associative in the usual sense, ( since (x1 : x2) : xs == x1 : (x2 : xs) / is not only untrue, but the left-hand side is 7 a type error, except maybe in some very special cases @ (and then the right-hand side would probably be a type error).  Is (:) what is called a right-associative operator? - And do I need to expand my Operator type to - include this? And then what about (-) and (/)??? 7 Does this affect their relationship with (+) and (-)? >HsPretty expressions. This is going to be like in Python.hs. )*+,-./0123456789:;<9:;34567812/0)*+,-.<)*+,-.*+,-./00122345678456789:;:;<=Python statement >'function name, formal parameters, body ?if condition action alt-action @import statement AB3Python module -- essentially a list of statements;  should it also have a name? CDEFGHPython return statement IPython if STATEMENT JPython variable KPython identifier LCPython character expression = string expression with one character !Python function formal parameter MDefines function definition NBinary operators 8 Precedence levels are rather *informally* described in  The Python Language Reference,  http:docs.python.org reference. / I am adopting the infixr levels from Haskell, * which seem to be consistent with Python, / at least for the operators that Sifflet uses. | Operator information  Arithmetic operators: ' + and - have lower precedence than *, , /, % B | Comparison operators have precedence lower than any arithmetic  operator. Here, I'"ve specified associative = False,  because association doesn'+t even make sense (well, it does in Python  but not in other languages); - (a == b) == c is in general not well typed. !Expr as an instance of PyPretty. 2 This instance is only for Exprs as Python exprs, 2 for export to Python! It will conflict with the & one in ToHaskell.hs (or Haskell.hs). 1The EOp case needs work to deal with precedences  and avoid unnecessary parens. < Note that this instance declaration is for *Python* Exprs. 6 Haskell Exprs of course should not be pretty-printed  the same way! =>?@ABCDEFGHIJKLMNDEFBC=A@?>GHIJKLMN=A@?>>?@ABCCDEFEFGHIJKLMN O1User configurable options for export to Haskell. % Currently these options are unused. ; The line width options should probably go somewhere else,  maybe as PrettyOptions. PQRS+The default options for export to Haskell. T2Export functions with specified options to a file U*Converting Sifflet to Haskell syntax tree 2Create a module from a module name and Functions. V&Create a declaration from a Function. 9 Needs work: infer and declare the type of the function.  Minimally parenthesized. W>Converts a Sifflet Expr to a fully parenthesized Haskell Expr $Map Sifflet names to Haskell names. 0 Returns a Left Operator for Haskell operators, A which always have the same name as their corresponding Sifflet G functions, or a Right String for Haskell function and variable names. OPQRSTUVW OPQRSTUVW OPQRPQRSTUVW XOptions for Python export. : Should probably include choices like Python2 or Python3; @ if statement or if expression. Right now, just a placeholder. YZ[\?Convert Sifflet name (of a function) to Python operator (Left)  or function name (Right) ]=Remove characters that are not valid in a Python identifier, 8 and in some cases, insert other characters to show what' s missing ^7Create a Python def statement from a Sifflet function.  Minimally parenthesized. _`ab XYZ[\]^_`ab XYZ[\]^_`ab XYYZ[\]^_`abcdefghAn Iolet is a circular port.  Other shapes could be added. ijklmnopqrstuvwxyz{|}~ftExtents: used for what?  tree style top left after padding the tree being laid out  (actually we don' t need the tree as an argument;  it's implied by the GNode tree)  node sizes  tree Sizes %Center a GNode in a rectangular area ycdefghijklmnopqrstuvwxyz{|}~ywxyz{|}~rstuvklmnopqhijgcdefycdefdefghiijklmnopqlmnopqrstuvstuvw xyz{|}~xyz{|}~5What is a FunctoidLayout? You can think of it as a  tree layout for a Frame, 4 or for a Functoid, or as a Forest of Tree Layouts! A For an Edit frame, it must be a forest, since the nodes are not ( yet necessarily connected into a tree. D For a call frame, it will be a single TreeLayout (singleton list). ?A Functoid is either a FunctoidParts, representing a partially 7 defined function, or a (completely defined) Function. > A FunctoidParts represents an incompletely defined function, G which has a function name, argument names, and a list of graph nodes 9 representing the function body which might not yet form / a complete expression tree, e.g., nodes might  be unconnected. "Graphically lay out the Functoid. - mvalues: Nothing implies an uncalled frame, E Just values implies a called frame, even with 0 arguments. +Two kinds of WNodes: ? A WSimple node represents a node in an expression tree, e.g., if, + M A WFrame node represents a panel or frame that displays an expression tree, & function call, or something similar. =A WGraph consists of WNodes with (sort of) Int-labled edges; 8 the edge labels serve to order the children of a node. -Insert new node with given label into graph,  without any new edges; 0 return the new graph and the new node (number) 8Remove a node from the graph; return the updated graph. ?Connect parent to child, using inlet as the order of the child @ (0, 1, ...). outlet is ignored, since there is only outlet 0.  As rendered, the parent'"s inlet-th inlet will have a line  to the child's outlet-th outlet. E This is achieved by inserting a labeled edge (parent, child, inlet) = and clearing any incompatible edge. The incompatibles are: : a. from same parent on same inlet to a different child. B b. from the same parent on a different inlet to the same child. = c. from same child (on same outlet) to a different parent. BNOTE: This is confusing, because, from the data flow perspective, ; data flows OUT of the child INTO the parent, but from the   tree in graph3 perspective, links are directed OUT of the parent  INTO the child. So beware! (Removes a link between parent and child 4 where the edge was labeled inlet (order of child). + Ignores outlet, which should always be 0. / If child is not the inlet-th child of parent, 6 well, this is an error, but grDisconnect ignores it. ( If toFrameP is true, the child node is % reconnected as a child to its frame   7Extract from a graph the expression with root node n,  returning a Tree of ExprNode. D Use only the WSimple nodes of the graph (and n had better be one).  1Finding characteristics of the WNodes in a graph ; It is an implicit error if there is no label for the node =wlab is like lab with no Maybe: the node *must* have a label  /llab is the tree layout node of a WSimple node  +The ExprNode represented by the graph node The repr of the node's value 6The result of an evaluated node in an expression tree The node's BBox =Finding the children (nodes, numbers) of a node in a graph : K all children, only WSimple-labeled children, only WFrame-labeled children ? When constructing the graph, ordered children of a tree node 7 get graph node numbers in ascending order; therefore, : sorting the graph nodes gives back the original order of : children in the tree (plus WFrames that are added later, 7 and those should always be after the simple children) (An open node has a WFrame-labeled child 9The graph node of the frame that contains the given node The parent (if any) of a node CReplace the tree embedded in graph g with root n, with a new tree. AExtract just the single tree layout node of the given graph node BExtract the tree layout (tree) descended from the given root node  7Translate the nodes forming a tree with the given root !"#'Replace the label of a node in a graph $Get the parts of a Functoid. + See note on functionToParts (just below).  Seems to be unused *** %!Convert a function to its parts.  COULDN'!T THIS BE DONE USING the function's implementation, C and not need to use the graph? Then this could go in Functoid.hs / without circular import between it and WGraph )      !"#$%)     !"# $%)      !"#$%&'()*+,-./3List of the nodes children, ordered by edge number 01234567&'()*+,-./01234567&'(*+12)-./0,34567&'()*+,-./01234567&89:;;A CanvFrame represents (indirectly, through cfRoot, and we 7 access to the graph which is provided by the VCanvas)  a subgraph such as the expression tree 0 of a function which is being edited or called. <=top area of the frame > bottom area ?variable (parameter) names @#the node opened to make this frame A#this frame as a node in the graph; ' also serves as the ID of the frame. Benvironment for evaluation C2box of the whole frame (header, tree, and footer) D(0 = bottom level, 1 = next higher, etc. Eincludes tlo for an edit frame Fedit or call frame G6Use levelOrder for sorting frames before drawing them H,The root of the tree displayed in the frame I A frame is  eval ready2 -- that is, okay to run the Eval Frame dialog -- & if it is a call frame with no parent JKLMNOPQAWhere to position a new frame that is grown out of an old frame? + This is a very rough draft of frameOffset RSTU8argIoletCounter returns (no. of inlets, no. of outlets) B derived from the argument list of a function still being defined Aligning a CanvFrame'0s header and footer with the body of the frame. G Aligns the header above, and the footer below, the body of the frame, - also matching the width if the body widened VKFigure out the frame layout for a function. Returns the layout and frame. % Currently, the frame is marked as a  call frame; if you want to edit it, ! call (editFrame? editFunction?) -CanvFrame needs to be Eq in order to be Ord, 5 but maybe the Eq and Ord definitions should be more  in the same spirit? 89:;<=>?@ABCDEFGHIJKLMNOPQRSTUV;<=>?@ABCDEF8:9UNIJKHVLMQGRTOPS8:99:; <=>?@ABCDEF<=>?@ABCDEFGHIJKLMNOPQRSTUVXW:A Dragging keeps track of the object (node) being dragged ! and the current mouse position. XYZ[\]^_`ab7A canvas that can display multiple boxes representing . expressions or function definitions or calls cdefghijklmn:ToolContext: The way a tool should be applied depends on  where it is being used opqrstuvwxy3ToolOp a is intended for a = VPUIWindow or VCanvas  type ToolOp a * = VPUI -> a -> ToolContext -> [Modifier] -> Double -> Double -> IO a z;A Toolbox is a framed VBox with a set of Toolbars attached {|}~BToolkit functions are organized in groups (rows) for presentation  in a toolbox container of the rest  the canvas 1VPUI: Sifflet (formerly VisiProg) User Interface " The initialEnv is apt to contain builtin functions;  it'1s preserved here so that when writing to a file, 9 we can skip the functions that were in the initial env. all the windows of the program ordered association list,  collections of tools the file opened or to save for windows, canvases, editors $initial value of global environment the global environment )global env as of last file open or save,  used to detect unsaved changes ;Tell whether the global environmkent has changed since the  last file open or save :Extract from the environment the part defined by the user > But you probably want to use Sifflet.UI.Window.UserFunctions  instead of this. "Insert a window in the window map 4Try to get the VPUIWindow with the given window ID,  return Just result or Nothing -Get the VPUIWindow with the given window ID;  it is an error if this fails. +Replace a VPUIWindow with given window ID;  it is an error if this fails. ?Apply an update function to a VPUIWindow with given window ID;  it is an error if this fails. @Apply an update IO action to a VPUIWindow with given window ID;  it is an error if this fails. DRemove a window from the windows map; it has already been destroyed  in the GUI $Try to find canvas; fail gracefully !Find canvas or fail dramatically 6Update the canvas of the specified window, without IO 3Update the canvas of the specified window, with IO 4A helper for making toolOps from actions on VCanvas XWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Z~z{|}stuvwnrqpoxybcdefghijklm[`^\aa_a]WXYZXWXYZXYZ[`^\aa_a]\]^_`ab cdefghijklmcdefghijklmnrqpoopqrstuvwtuvwxyz{|}{|}~Commands for the CBMgr FThe CBMgr (Callback manager) encapsulates (in an enclosure, no less!) 9 an IORef VPUI. It is used *solely* to set up callbacks ; and similar stuff in Gtk, where the callback needs access 9 to the IORef. By passing a CBMgr to a function, we can 8 avoid passing the IORef directly, and all the harm and  confusion that could result. .We only need *one* CBMgr for the application; C however, two CBMgrs with the same IORef are logically equivalent, J so there would be no harm in having two as long as they share one IORef. Create the CBMgr <Read an IORef, update with IO, and write the updated value. N This is like modifyIORef, but the type of the second argument is (a -> IO a)  instead of (a -> a).  "-use explicit lambda in function definitions,  (define f (lambda (a b) ...)  An SExpr is flattish if it is an atom & or is a list containing only atoms, % where the empty list () is an atom. Newline and indent +Convert Sifflet Functions to Scheme SExprs +Convert Sifflet Functions to pretty Scheme .Convert a FunctionDefTuple to a Scheme SExpr. * Use the form (define (name . args) body) 7 except when there are zero arguments, which becomes a ) Scheme constant rather than a function,  use (define name expr). #Export functions to a Scheme file. The path to the  sifflet.scm file.   DParse a Sifflet data literal (number, string, char, bool, or list),  returning an Expr 8Parse a Sifflet literal expression and return its Value /Try to parse an input value of a specific type ,Try to parse input values of specific types input strings expected types DTry to parse an input value for a named variable of a specific type @Try to parse input values for named variables of specific types inputs variable names variable types *Like expr, but consumes the entire input, @ so there must not be any extraneous characters after the Expr. 'nothingBut p is like p!, but consumes the entire input, : so there must be no extraneous characters (except space)  after whatever p parses. ;Parse a Sifflet data expression -- actually only a literal  or a list of literals. -Parser for a Value of any type (any VpType), = except that we cannot parse as VpTypeVar or VpTypeFunction. 4Parser for a value with a specific VpType expected. 3 Again, we cannot do this for VpTypeVar (why not?)  or VpTypeFunction 7A name for the type, for use in parser error reporting *=Ask the vcanvas to update the frame and install a new graph. @ Frames are identified by their frame nodes, so the new frame + must have the same frame node as the old. > It is an unreported error if there is not exactly one match. /Like vcUpdateFrameAndGraph, but keep the canvas' s old graph. Make nothing be selected The Graph Node of a Selection *What is selected (if anything) at a point Connect nodes Disconnect nodes /Remove the (sub)tree rooted at the given node. ) Removes it from the graph of the canvas * and from the FunctoidParts of the frame. 3Add a frame representing a functoid to the canvas. CUse mvalues = Nothing if you do not want the frame to be evaluated 6 as a function call, otherwise mvalues = Just values. 7prevEnv is *supposed* to be the previous environment,  i.e., that of the  parent, frame or the canvas, not of the new frame, 7 because vcAddFrame itself will extend the environment  with the new (vars, values). 5 But this is odd, because openNode calls vcAddFrame 3 apparently with the *new* environment as prevEnv,  and yet it works correctly. FCaution: I think it is necessary for the canvas to have been realized  before calling this function!  /Return a canvas of at least the specified size & and otherwise like the given canvas.     :Find the node, if any, at a given position on the canvas. CeditFunction: reverse of defineFunction: replace the call frame by J an edit frame; does not change the VPUI (global env.), just the canvas..  Find a frame',s subframes, i.e., those that were expanded , to trace the execution of a function call.  Cannot be in an edit frame. 2Given a graph with a rooted tree, collect list of  subframes, 5 i.e., frames that are children of nodes in the tree CEvaluate the frame, having gotten a list of values from the dialog >vcClearFrame - clear a frame in a canvas; not yet implemented  What does this mean? &Close a frame and any subframes of it ;Close any subframes of the frame, but not the frame itself "Is our canvas editing a function? 4Find the frames that are calling the named function                +argument name function name  !"#$%&'/Check that all required modifiers are in found ()*+,-.3Add a frame representing a functoid to the canvas = of a particular window, specified by its window id (title). /3Add a frame representing a functoid to the canvas < of a VPUIWindow (which ought to have a canvas, of course).  Otherwise like vcAddFrame. 01IOpen an entry for user input of function name to select a function tool. E Returns unaltered VPUI, for convenience in menus and key callbacks. 2,Show an entry for input of a literal value. E Returns unaltered VPUI, for convenience in menus and key callbacks. (New, light replacement for most dialogs "Prompt for input in a text entry. B When the user presses Return, attempt to parse the input text. @ If parse succeeds, apply the toolType to the resulting value 7 to produce a ToolId and set the corresponding tool. ? If user presses Escape, the input is closed with no action. @ If mcompletions is (Just comps), comps is a list of possible  completions for the entry. IReturns the vpui, with NO UPDATE, for convenience in callbacks and menus 8When activated, send a message to set the current tool Set actions for Tab and Escape 3+For debugging (frame context menu command) 4+For debugging (frame context menu command) 5For debugging the window's widget children 6(Clear frame indicated by mouse location 7#Close frame (context menu command)  !"#$%&'()*+,-./01234567  '-0(,&)*+%12!"/.$#34567   !"#$%&'()*+,-./012345678Create a new VPUI.  This used to set up the basic  q to quit and  on exposed callbacks, " but now does not even do that.  The  function argument ( may perform additional initialization;  if there is none, simply use . 9 Create a new main' workspace window, with a given style. I The second argument should set up a menu bar and place it on the vbox, % or do nothing if no menu is wanted. :;<Add Apply and Close% buttons to a function-editor window  ?fedFuncFrame generates a throw-away frame for the sole purplse > of obtaining its measurements before initializing the canvas  >If mViewSize is Nothing, no scrollbars are put on the canvas, 3 and its display size request is its natural size. B If mViewSize = Just viewSize, then scrollbars are wrapped around 9 the canvas, and its displayed size request is viewSize. = addMenuBar is an action which, if desired, adds a menu bar;  if you don't want one, just pass ( _ -> return ()). = %List of all window ids of the vpui, >Perform action on all windows & (actually (WinId, VPUIWindow) pairs. 9 Returns updated VPUI (in case any windows are changed). ?CThis function is called either when a window *has been* destroyed,  with destroy = False, > or when you *want to* destroy a window, with destroy = True. =removeWindow actually *closes* the window if destroy = True, % as well as removing it from the vpui's windows map. @6Context menu command to apply the function definition  of an EditFrame. Execute4 the definition currently represented in the frame, 8 i.e., bind the function name in the global environment 0 to the function definition found in the frame. A GIn the workspace window, update each frame calling the named function , to reflect the current function definition  =In the canvas, update a call frame with the current function : definition from the environment, returning a new canvas. N Root call frames are torn down and rebuilt with the new function definition. H Call frames that are called by other call frames are simply torn down. BC 89:;<=>?@ABC 89:;<@AB?=>C 89:;<=>?@ABC An XMLConsumer consumes XML An XMLProducer produces XML DEFG)Convert a literal expression to a value. . It is an error if the expr is not a literal.  Compare exprToValue in Expr.hs HIHtestFromXml :: (ToXml a, Show a) => a -> XMLConsumer XmlTree a -> IO () N VVV This type generalization (a, a to a, b) is for debugging, undo it later:  Functions VpTypes Values / Still used in exprToXml in the EList case :-( Expr  Symbols DEFGHIDEFGHIDEEFGHI!U!" help or quit #modify VPUI with IO $start a dialog % set a tool &'()*+,J9Finding, creating, and initializing windows (VPUIWindow) &Find and show a window, if it exists. 0 If not, create the window, put it in the vpui's window map, K and initialize it and any auxiliary objects using the initWin function. 1 The 3rd argument of initWin will be the window' s title. 0 Always presents the window (shows and raises). 8 Returns a 3-tuple: the VPUIWindow contains the Window, 1 and the Bool value is True if the Window is new 9 (and therefore might need some further initialization). 8 The third tuple element is an IORef to the VPUIWindow; < it may be useful for setting up signal and event handling. -Default  do-nothing add-callbacks function KLFShow a workspace window, with a given title, _not_ editing a function MFShow a workspace window with a given title and maybe function to edit .Initialize a Workspace window. L Called in sifflet.hs:Main from showWindow called from showWorkspaceWindow. /N4Show a function editor window = a workspace window  editing a given function. D Use argNames for a new function; ignore them if funcName is bound. O0P1234567BAdd a tool button to the function pad window in a specified panel Q.Ask user for new function name and arguments, " then begin editing the function. 8Quit from Sifflet 9,Open a file (load its function definitions) :COffer to save changes, if any, and continue with the continuation. @ The continuation gets the current vpui if there are no changes ; or if the offer to save is rejected; otherwise, it gets a 1 vpui which knows it has saved its last changes. : The message, if any, is a confirmation that the file was 9 saved and that we are going on to the next operation -- ) useful for open file, but not for quit. ;DContinue with opening the file, after having possibly saved changes R4Now that we have a file path, go ahead and open it, / loading the function definitions into Sifflet <=>?Implements File menu Save command. @Implements File menu Save as command. A4Unconditionally save user functions in SiffML file. . Called from menuFileSave and menuFileSaveAs. ' Updates vpuiFilePath and vpuiFileEnv. B.The user-defined functions of the environment C!Export user functions to a file,  given an exporter and a path,  returning the vpui unchanged. D&Export user functions to Haskell file E%Export user functions to Python file F%Export user functions to Scheme file GCChoose an output file, for file save, save as, and export commands HIJText shown by the help dialog KShow the help dialog LHow to report bugs MNOText for the About dialog PThe software version number. - See ACTION: RELEASE CHECKLIST for a list of < places where this version number needs to be synchronized. QSR8Context menu command to edit the function displayed in  a CallFrame S9Create a new function, add it to the global environment > with body undefined, and start editing it in a new window.  Also update and show  My Functions toolbox and  update its toolkit. TUHandle the Configured event. VW=Handle the Exposed event, should be called only for a window  with a canvas X9Key bindings map. This is derived from keyBindingsList. Y;KeyBinding list for workspace and function editor windows. Z(Unused argument needed for key bindings T"Help text built from key bindings [!What to do when a key is pressed \]^_BHandle the ButtonPress event. Should be called only for a window  with a canvas. `"Handles button pressed in a frame a.Handles button pressed in the body of a frame D frameBodyButtonPressed needs VPUIWindow because it calls a toolOp. 7 mb (mouse button) is unused, but might be used later. b5Handles left button pressed in the footer of a frame c Handles beginning of mouse-drag dHandle mouse move event efghi0Show a context menu for mouse click in a frame. j8Options for context menu that depend on the frame type. JKLMNOPQRST JKLMNOPQRST JKLMNOPQRST#  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&'()*+,-./0123456789:;<89:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCJKLMNOPQRSTk$%&$%'$%($%)*+,*-.*-/*-0*-1*-2*-3*-4*-5*-678978:78;78<78=7>?7@A7@B7@C7@D7@E7@F7@G7@H7@I7@J7@K7@L7@M7@N7@O7@P7@Q7RS7TU7VW7VX7YZ7[\7[]7[^7[_7[`7[a7[b7cd7ce7cf7cg7ch7ci7cj7ck7cl7cm7cn7co7cp7cq7cr7cs7ct7cu7cv7cw7cx7cy7cz7c{7c|7c}7c~7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c77777777777777777777777777777777777777777777777777777777777777777 7 7 7 7 777777777777777777 7!7"7#7$7%7&7'(7')7'*7'+7',7'-7'.7'/7'07'17'27'374574674774874974:74;74<74=74>74?74@74A74B74C74D74E74F74G74H74I74J74KLMNLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~           p p                                                                                                                                           ! " # $ % & ' ( ) * + , - . / 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 [ \ ] ^ _`abcdefghijkllmnopqqrrsstuvwxyz{|}~{      !"#$%&'()*+,-./01234456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk l m n o p q!r!s!t!u!v!w!x!y!z!{!|}~""""""""""s|                }                                                     e      !"#$%&'()*(+,-./0123 4 5 6 7 8  9 : ; < = > ? @ A B C D E!F!G!H!I!J!K!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!t!u!v!w!x!y!z!{!|!}!~!!!!!!!!!!!!!!!!sifflet-lib-1.1Sifflet.Data.TreeSifflet.UI.LittleGtkSifflet.Language.ParserSifflet.UI.GtkForeignSifflet.Text.Pretty Sifflet.UtilSifflet.UI.RPanelSifflet.UI.GtkUtilSifflet.Data.GeometryData.Number.SiffletSifflet.Text.ReprSifflet.Language.ExprSifflet.ExamplesSifflet.Foreign.ExporterSifflet.Foreign.HaskellSifflet.Foreign.PythonSifflet.Foreign.ToHaskellSifflet.Foreign.ToPythonSifflet.Data.TreeLayoutSifflet.Data.FunctoidSifflet.Rendering.DrawSifflet.Data.WGraphSifflet.Data.TreeGraphSifflet.UI.FrameSifflet.UI.TypesSifflet.UI.CallbackSifflet.Rendering.DrawTreeGraphSifflet.Foreign.ToSchemeSifflet.UI.CanvasSifflet.UI.ToolSifflet.UI.WorkspaceSifflet.Language.SiffMLSifflet.UI.WindowPaths_sifflet_lib Sifflet.UIcontainers-0.3.0.0 Data.Tree subForest rootLabelNodeTree glib-0.11.2System.Glib.SignalsonSystem.Glib.Attributesgetset:=:~:=>:~>::=::~AttrOp gtk-0.11.2Graphics.UI.Gtk.General.General grabRemovegrabAddmainQuitmainGUIinitGUIGraphics.UI.Gtk.Gdk.DrawWindowdrawWindowInvalidateRectGraphics.UI.Gtk.Abstract.Widget onSizeRequest onDestroy keyPressEvent exposeEventbuttonPressEvent widgetVisiblewidgetSetCanFocuswidgetSetSizeRequestwidgetSetDoubleBufferedwidgetClassPathwidgetAddEvents widgetSetNamewidgetGrabFocuswidgetSizeRequest widgetDestroy widgetShowAll widgetShowGraphics.UI.Gtk.Buttons.ButtonbuttonNewWithLabel%Graphics.UI.Gtk.MenuComboToolbar.Menu menuPopupGraphics.UI.Gtk.Display.Label labelSetTextlabelNew+Graphics.UI.Gtk.Selectors.FileChooserDialogfileChooserDialogNewGraphics.UI.Gtk.Windows.Window windowTitle windowMove windowPresentwindowSetPositionwindowSetDefaultSizewindowSetTitle windowNewGraphics.UI.Gtk.Gdk.CursorXCursorArrowBasedArrowDown BasedArrowUpBoatBogosityBottomLeftCornerBottomRightCorner BottomSide BottomTee BoxSpiral CenterPtrCircleClock CoffeeMugCross CrossReverse Crosshair DiamondCrossDotDotbox DoubleArrow DraftLarge DraftSmall DrapedBoxExchangeFleurGobblerGumbyHand1Hand2HeartIcon IronCrossLeftPtrLeftSideLeftTee LeftbuttonLlAngleLrAngleMan MiddlebuttonMousePencilPiratePlus QuestionArrowRightPtr RightSideRightTee RightbuttonRtlLogoSailboat SbDownArrowSbHDoubleArrow SbLeftArrow SbRightArrow SbUpArrowSbVDoubleArrowShuttleSizingSpiderSpraycanStarTargetTcross TopLeftArrow TopLeftCornerTopRightCornerTopSideTopTeeTrekUlAngleUmbrellaUrAngleWatchXterm LastCursor BlankCursorCursorIsPixmap CursorTypeGraphics.UI.Gtk.CairorenderWithDrawableGraphics.UI.Gtk.Windows.DialogdialogSetDefaultResponsedialogAddButton dialogRun dialogNew%Graphics.UI.Gtk.Windows.MessageDialogmessageDialogNew MessageInfoMessageWarningMessageQuestion MessageError MessageOther MessageType ButtonsNone ButtonsOk ButtonsClose ButtonsCancel ButtonsYesNoButtonsOkCancel ButtonsType!Graphics.UI.Gtk.Display.Statusbar statusbarPop statusbarPushstatusbarGetContextId statusbarNewGraphics.UI.Gtk.Entry.EntryentryGetCompletionentrySetCompletion entryGetText entrySetTextentryNew%Graphics.UI.Gtk.Entry.EntryCompletionentryCompletionModelentryCompletionInsertPrefixentryCompletionSetTextColumnentryCompletionNew#Graphics.UI.Gtk.ModelView.ListStore listStoreNew#Graphics.UI.Gtk.ModelView.TreeModelmakeColumnIdString%Graphics.UI.Gtk.ModelView.CustomStorecustomStoreSetColumn%Graphics.UI.Gtk.Selectors.FileChooserfileChooserGetFilenameFileChooserActionOpenFileChooserActionSaveFileChooserActionSelectFolderFileChooserActionCreateFolderFileChooserActionGraphics.UI.Gtk.Layout.HBoxhBoxNewGraphics.UI.Gtk.Layout.Layout layoutSetSize layoutPut layoutNewGraphics.UI.Gtk.Layout.ExpanderexpanderSetExpanded expanderNewGraphics.UI.Gtk.Layout.VBoxvBoxNewGraphics.UI.Gtk.Ornaments.FrameframeNew(Graphics.UI.Gtk.Scrolling.ScrolledWindowscrolledWindowSetPolicyscrolledWindowNewGraphics.UI.Gtk.Misc.Adjustment adjustmentNewGraphics.UI.Gtk.Misc.EventBox eventBoxNewGraphics.UI.Gtk.Abstract.BoxboxPackStartDefaults boxPackEnd boxPackStart"Graphics.UI.Gtk.Abstract.ContainercontainerChildcontainerForeach containerAddGraphics.UI.Gtk.General.StructslayoutGetDrawWindowdialogGetActionAreadialogGetUpper Requisition ResponseNoneResponseRejectResponseAcceptResponseDeleteEvent ResponseOkResponseCancel ResponseClose ResponseYes ResponseNo ResponseApply ResponseHelp ResponseUser ResponseIdGraphics.UI.Gtk.TypestoDialogcastToContainer DrawWindow WidgetClassLabelContainerClassButtonWindowDialogScrolledWindowExpanderVBoxHBox StatusbarLayoutEntryGraphics.UI.Gtk.General.Enums PackRepelPackGrow PackNaturalPackingPolicyAutomatic PolicyType WinPosNone WinPosCenter WinPosMouseWinPosCenterAlwaysWinPosCenterOnParentWindowPositionGraphics.UI.Gtk.Gdk.Enums ExposureMaskPointerMotionMaskPointerMotionHintMaskButtonMotionMaskButton1MotionMaskButton2MotionMaskButton3MotionMaskButtonPressMaskButtonReleaseMask KeyPressMaskKeyReleaseMaskEnterNotifyMaskLeaveNotifyMaskFocusChangeMask StructureMaskPropertyChangeMaskVisibilityNotifyMaskProximityInMaskProximityOutMaskSubstructureMask ScrollMask AllEventsMask EventMask pango-0.11.2 Graphics.Rendering.Pango.Structs Rectangleparsec-2.1.0.1"Text.ParserCombinators.Parsec.Prim parseTest setCursor GtkLayoutGtkFramePrettypretty prettyList indentLinesepLines sepLines2sepComma sepCommaSpsepSpaceSuccFailFailSuccparsefparseInt parseDouble parseVerbatimpar putCatsLnputCatLninfofakestuberrcaterrcatsmap2mapM2insertLastLast insertLast adjustAList adjustAListMRPanelrpanelId rpanelRoot rpanelContent newRPanelrpanelAddWidgetsrpanelAddWidget rpanelNewRow rpanelAddRows EntryDialogReadersuppressScimBridgeshowChoicesDialogdefaultDialogPosition runDialogS runDialogMshowInputErrorMessageshowErrorMessageshowInfoMessage showMessagecreateEntryDialogrunEntryDialogaddEntryWithLabel Translate translateWidenwidenBBoxSizesizeWsizeH circleCenter circleRadiusPositionposXposY positionDeltapositionDistancepositionDistanceSquaredpositionCloseEnough pointInCirclebbXbbYbbWidthbbHeight bbPositionbbSizebbCenter bbSetWidthbbLeft bbXCenterbbRightbbTop bbYCenterbbBottombbToRect bbFromRectbbMerge bbMergeList pointInBBNumberInexactExactisExact toInexactadd1sub1eqZerogtZeroltZeroNameReprreprreprlreprsreprListtreeleafisLeaftreeSize treeDepthnameTreeputTreeputTreeR putTreeRsputTreeS drawTreeShowEnvFunctionDefTuple FunctionImplCompound PrimitiveFunction FunctionsTypeEnvVpType VpTypeVarVpTypeFunction VpTypeList VpTypeString VpTypeNum VpTypeChar VpTypeBoolValueVListVFunVStringVNumberVCharVBoolEvalRes EvalUntried EvalErrorEvalOk EvalResult ExprNodeLabelNListNStringNNumberNCharNBoolNSymbol NUndefinedExprNodeENodeExprTreeOperatorGrouping GroupNone GroupRtoL GroupLtoR PrecedenceOperatoropNameopPrecopAssoc opGroupingExprEGroupEOpECallEListEIfEStringENumberECharEBoolESymbol EUndefinedOCharOBoolOStrSymbol exprIsLiteral exprIsAtomicexprIsCompoundeSymboleSymeInteStringeChareFloateBooleFalseeTrueeIfeListeCallexprNodeIoletCounter exprToTree treeToExprexprToReprTreeevalTree unevalTree valueFunction exprToValuevalueToLiteralvalueToLiteral' emptyTypeEnv typeMatchvpTypeOf typeChecknewUndefinedFunction functionName functionNArgsfunctionArgTypesfunctionResultType functionTypefunctionImplementationfunctionArgNames functionToDeffunctionFromDef functionBodyemptyEnvmakeEnv extendEnv envInsertLenvInsenvSetenvGetenvGetFunction envLookupenvLookupFunction envSymbolsenvFunctionSymbols envFunctionsenvPopevalapplyePluseTimeseMinuseDiveModeAdd1eSub1eEqeNeeGteGeeLteLeeZerop ePositivep eNegativepbaseEnv exprSymbols exprVarNames decideTypesundefinedTypesfooeFooeMaxeFactexampleFunctionsexampleFunctionNames exampleEnvgetExampleFunctionExporter simplifyExpr findFixedcommonRuleHigherPreccommonRuleAtomiccommonRuleLeftToRightruleRightToLeftcommonRuleAssocRight ruleIfRightcommonRuleFuncOpcommonRulesForSimplifyingExprsapplyFirstMatchDecl declIdentdeclType declParamsdeclExpr ImportDecl ExportSpecModule moduleName moduleExports moduleImports moduleDeclsHsPrettyhsPretty hsPrettyList operatorTable PStatementPFunPCondSPImportPReturnPModulePyPrettypyPretty pyPrettyList alterParensretcondSvaridentcharfunHaskellOptionsoptionsSoftMaxLineWidthoptionsHardMaxLineWidthdefaultHaskellOptions exportHaskellfunctionsToHsModulefunctionToHsDecl exprToHsExpr PythonOptionsdefaultPythonOptions exprToPExpr nameToPythonfixIdentifierCharsfunctionToPyDefdefToPyfunctionsToPyModulefunctionsToPrettyPy exportPython LayoutNode nodeGNode nodeTreeBB TreeLayoutIolet IoletCounterGNode gnodeValuegnodeTextBoxes gnodeNodeBB gnodeInlets gnodeOutletsTextBoxtbTexttbTextBBtbBoxBBFontTextExtents fontAscent fontDescent fontHeightfontMaxXadvancefontMaxYadvance textXbearing textYbearing extTextWidth extTextHeight textXadvance textYadvanceStyle styleFont lineWidth textMarginhpadvpad exomarginvtinypad styleFramePadstyleNormalTextColorstyleNormalFillColorstyleNormalEdgeColorstyleActiveTextColorstyleActiveFillColorstyleActiveEdgeColorstyleSelectedTextColorstyleSelectedFillColorstyleSelectedEdgeColorstyleTetherColorstyleAuxOffset styleAuxColor styleAuxFontstyleIoletRadiusstyleShowNodeBoxesstyleShowNodePortsVFont vfontFace vfontSlant vfontWeight vfontSizeVColor ColorRGBAColorRGBblackwhitecream lightBluelightBlueGreen lightGray mediumGraydarkGrayyellow darkBlueGreen blueGreenstyleIncreasePaddingstyle0style1style2style3 defaultStylewstylepointInLayoutNode pointInGNodefindRectsetFont measureTextstyleTextExtents ftExtents makeTextBoxtbWidth tbSetWidthtbHeighttbBottomtbCenter tbBoxCenter tbTextCenteroffsetTextBoxCenters gnodeText gnodeTextBBzeroIoletCounter makeGNode makeIolets makeIoletsRow ioletCenter pointInIolet treeSizeslayoutNodeSource layoutRootBB layoutTreeBB treeLayout treeGNodestreeLayoutPaddedSizetreeLayoutSizelayoutTreeMoveCenterTotreeLayoutWidthtreeLayoutWidenFunctoidLayout FLayoutForest FLayoutTreeFunctoid FunctoidFuncfpFunc FunctoidPartsfpNamefpArgsfpNodes functoidNamefunctoidArgNamesfunctoidHeaderflayout flayoutBBox flayoutSize flayoutWidth flayoutBottom flayoutWidenDrawModeDrawSelectedOutletDrawSelectedInletDrawSelectedNode DrawActive DrawNormalDrawdrawsetColor drawTextBoxdrawBox modeFillCol modeTextCol modeEdgeColWNodeWFrameWSimpleWEdgeWGraph wgraphNew grInsertNode grRemoveNode grConnect grDisconnectconnectToFrame grAddGraphgrExtractExprTreewlabllab nodeExprNodenodeText nodeValuenodeBBox nodePositionnodeInputValuesnodeAllChildrennodeSimpleChildrennodeAllSimpleDescendantsnodeProperSimpleDescendantsnodeFrameChildren nodeIsSimple nodeIsOpennodeContainerFrameNode nodeParentgrUpdateFLayoutgrUpdateTreeLayoutgrExtractLayoutNodegrExtractLayoutTree translateTreetranslateNodes translateNode grRelabelNode functoidPartsfunctionToParts LayoutGraphflayoutToGraphtreeLayoutToGraphflayoutToGraphRootsorderedTreeToGraphtreeGraphNodesTree nextNodesgraphToOrderedTreegraphToOrderedTreeFromorderedChildrenadjCompareEdgegraphToTreeOriginalgraphToTreeStructuregrTranslateNodegrTranslateSubtreegrTranslateGraphfunctoidToFunctiongraphToExprTree FrameType CallFrame EditFrame CanvFramecfHeadercfFooter cfVarNamescfParent cfFrameNodecfEnvcfBoxcfLevel cfFunctoid frameType levelOrdercfRoot cfEvalReadycfPointInHeadercfPointInFooter frameBodyBox frameNodeAtatLeastSizeFrame resizeFrametranslateFrame frameOffsetnodeCompoundFunctiongrTranslateFrameNodes pointIoletargIoletCounterframeNewWithLayoutDragging draggingNodedraggingPosition SelectionSelectionOutlet selOutEdgeSelectionInlet selInEdge SelectionNodeselNodeVCanvasvcLayoutvcStylevcGraphvcFramesvcSize vcMousePosvcToolvcActive vcSelected vcDragging ToolContext TCExprNode TCEditFrame TCCallFrame TCWorkspaceTooltoolName toolActivatedtoolOp CanvasToolOpToolOpToolbox toolboxFrame toolboxVBox VPToolkit toolkitName toolkitWidth toolkitRowsFunctionEditor fedWindow fedWinTitle fedFunction fedCanvas WorkspacewsBoxwsCanvas wsButtonBar wsStatusbarWinId VPUIWindowFunctionPadWindow VPUIWorkWinVPUI vpuiWindows vpuiToolkits vpuiFilePath vpuiStylevpuiInitialEnv vpuiGlobalEnv vpuiFileEnvvpuiFileChangedvpuiUserEnvAListvpuiInsertWindowvpuiTryGetWindow vpuiGetWindowvpuiReplaceWindowvpuiUpdateWindowvpuiUpdateWindowIOvpuiRemoveVPUIWindowvpuiWindowWindowvpuiWindowLookupCanvasvpuiWindowGetCanvasvpuiWindowSetCanvasvpuiWindowModCanvasvpuiWindowModCanvasIO vpuiModCanvasvpuiModCanvasIOfedFunctionName toToolOpVWMenuItemAction MenuItemSpecSubMenuMenuItemMenuSpecCBMgrCmdUMTestAfterButtonClickedOnEntryActivateOnMenuItemActivateLeafOnLayoutButtonReleaseOnLayoutButtonPressOnLayoutMouseMoveOnLayoutExposeOnWindowKeyPressOnWindowDestroyOnWindowConfigureCBMgrmkCBMgr createMenuBaraddMenu createMenucreateMenuItem modifyIORefIOgraphQuickViewgraphWriteImageFile graphRender treeRendertreeWriteImageFile gtkShowTree SchemeOptionsdefineWithLambdaIndentAtom SFunctionSBoolSCharSStringSSymbolSIntSFloatSExprSListSAtomdefaultSchemeOptions exprToSExprfunctionNameToSchemeName valueToSExprexprToSchemeReprexprToSchemePretty exprToSchemeinlfunctionsToSExprsfunctionsToPrettyScheme defToSExpr exportScheme parseExpr parseValue parseLiteral parseSuccFailparseTypedInput2parseTypedInputs2parseTypedInput3parseTypedInputs3 nothingButexprlistvalue typedValueboolqcharqstringintegerdoublenumber vcanvasNewnodeContainerFrame vcGetFramevcUpdateFrameAndGraphvcClearSelectionpointSelectionconnect disconnectvcFrameAddFunctoidNodevcFrameAddNodevcFrameDeleteNodevcFrameDeleteTree vcAddFrame atLeastSizevcInvalidateFrameWithParentvcInvalidateBox frameChanged drawCanvas vcanvasNodeAtvcanvasNodeRect whichFrame editFunctionvcFrameSubframes vcEvalDialog vcClearFrame vcCloseFrame cfContext callFramesToolIdToolArg ToolLiteral ToolFunction ToolDeleteToolMoveToolIfToolDisconnect ToolConnect vpuiSetToolvpuiWindowSetToolwsPushStatusbarwsPopStatusbar makeMoveToolmakeDeleteTool checkModsmakeConnectToolmakeDisconnectToolmakeFixedArgTool makeIfTool makeCopyTool functionTool vpuiAddFrame vwAddFramefunctionToolsFromListsshowFunctionEntryshowLiteralEntry dumpFrame dumpGraph dumpWorkWin clearFrame closeFramevpuiNewworkspaceNewDefaultworkspaceNewEditingaddArgToolButtonsaddApplyCloseButtonsvpuiQuitforallWindowsIO removeWindowdefineFunction workspaceIdopenNodebaseFunctionsRowsToXmltoXmlproduceSiffMLFileconsumeSiffMLFilexmlToFunctions testFromXml showWindownewWindowTitled showWorkWinshowWorkspaceWindow showFedWinfedWindowTitleshowFunctionPadWindownewFunctionDialog openFilePathsetWSCanvasCallbackskeyBindingsHelpText gdkCursorNewgdkWindowSetCursorcursorTypeNumberversionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileNamerpIdrpRoot rpContentrpFrame rpExpanderrpVBox rpCurrentRowrpCurrentRowFreeWidth rpMaxWidthrpHPad debugTracing rpanelAddRow createDialogrunDialogHelper addEntriestoDoubleexactOp1 inexactOp1 eitherOp1exactOp2 inexactOp2 eitherOp2$fFloatingNumber$fFractionalNumber$fIntegralNumber $fEnumNumber $fRealNumber $fNumNumber $fOrdNumber $fShowNumberBindingEnvFrameeNegateexprIsExtendedevalTreeWithLimitliteralToValueunbound stackSize evalWithLimitprimitiveFunctionsprim primIntDivMod primIntDiv primIntMod primFloatDivprimArgCountErrorprimNullprimHeadprimTailprimConsprimN2NprimN1NprimN2BprimN1B $fEqFunction grossProfitbonus1bonus2maxfact sumFromZerobuggySumFromZeroeFib1fib1 eSumFromZerormuleRmuleGcdgcdeEvenpeOddpevenpoddp eRabbitBabies eRabbitAdults rabbitTotal rabbitAdults rabbitBabies buggyLength listLengthlistSumsumbodybuggySumtopDown$fHsPrettyExprpyPrettyParensparam$fPyPrettyExprpathToModuleName haskellRules nameToHaskellpyRulespythonLibSiffletPathfindNode paddedWidth paddedHeight treeLayout2 centerGNodetreeLayoutAddMargin drawIolet drawInlets drawOutlets drawIolets drawCircle edgeNotEqual edgeNotTosproutgrUpdateNodeLabeleditFrameNodeseditFrameNodeAtcallFrameNodeAt alignHeader alignFooterbuildFooterText $fEqCanvFrame updateCanvaskeyPressflattishatom prettyLoop displayList1 displayList2 displayTailschemeLibSiffletPathSignMinusinputprog1typeName escapedCharunsignedIntegeroptSign applySignenableDoubleBuffering vcUpdateFrame vcDeleteFramegraphRenderFunctoidPartsgraphRenderForestgraphRenderTreegraphStartRendergraphRenderNode selectionNodevcInvalidateSimpleNodegrTreeSubframeNodes evalFramevcCloseSubframes canvasEditing toolIdToTooldefaultContextDescriptionconnmakeFixedLiteralTool dummyTool showToolEntryentryActivatedaddEntryCompletions entryKeyPress dumpWidgetwidgetClassNamebaseGHC.ListinitGHC.BasereturnaddArgToolButtonaddApplyCloseButtons2 fedFuncFrame workspaceNewvpuiAllWindowKeysvpuiUpdateCallFramescanvasUpdateCallFrame XMLConsumer XMLProducerdefaultOptions symbolToXml exprToXml xmlToExpr valueToXml xmlToValue vpTypeToXml xmlToVpType functionToXml xmlToFunctionfunctionsToXml$fToXmlFunction $fToXmlVpType $fToXmlValue $fToXmlExpr $fToXmlSymbol KeyAction KeyActionHQKeyActionModIO KeyActionDG KeyActionST KeyBinding kbGtkKeyName kbAltKeyNamekbRequiredModifiers kbDescriptionkbAction initCBDefaultworkspaceWindowInit buildMainMenuupdateFunctionPadIOfunctionPadWinIdaddUserFunctionsmakeFunctionPadPanelmakeToolButtonRowsmakeNamedToolButtonmakeToolButtonaddFunctionPadToolButton menuFileQuit menuFileOpencheckForChangescontinueFileOpenshowDialogFileOpenloadFile bindFunction menuFileSavemenuFileSaveAssaveFile userFunctionsmaybeExportUserFunctionsmenuFileExportHaskellmenuFileExportPythonmenuFileExportSchemechooseOutputFilemaybeDefaultOptionsmaybeRunSchemeOptionsDialoghelpTextshowHelpDialogbugsTextbugReportAddressshowBugs aboutTextsiffletVersionStringshowAboutDialogeditFrameFunctioneditNewFunctionconfiguredCallbackhandleConfiguredexposedCallback handleExposedkeyBindingsMapkeyBindingsList vpuiKeyHelpkeyPressCallbackbuttonPressCallbackmouseMoveCallbackbuttonReleaseCallbackhandleButtonPressframeButtonPressedframeBodyButtonPressedleftButtonPressedInFrameFooterbeginFrameDraghandleMouseMove continueDragcontinueDragSimplecontinueDragFramehandleButtonReleaseofferContextMenucontextMenuOptions