sifflet-lib-1.2: Library of modules shared by sifflet and its tests and its exporters.




atLeastSize :: Size -> VCanvas -> VCanvasSource

Return a canvas of at least the specified size and otherwise like the given canvas.

connect :: VCanvas -> Node -> WEdge -> Node -> WEdge -> IO VCanvasSource

Connect nodes

disconnect :: VCanvas -> Node -> WEdge -> Node -> WEdge -> IO VCanvasSource

Disconnect nodes

editFunction :: VCanvas -> CanvFrame -> IO VCanvasSource

editFunction: reverse of defineFunction: replace the call frame by an edit frame; does not change the VPUI (global env.), just the canvas..

pointSelection :: WGraph -> CanvFrame -> Position -> Maybe SelectionSource

What is selected (if anything) at a point

vcAddFrame :: VCanvas -> Functoid -> Maybe [Value] -> FrameType -> Env -> Double -> Double -> Double -> Maybe Node -> IO VCanvasSource

Add a frame representing a functoid to the canvas.

Use mvalues = Nothing if you do not want the frame to be evaluated as a function call, otherwise mvalues = Just values.

prevEnv is *supposed* to be the previous environment, i.e., that of the parent frame or the canvas, not of the new frame, because vcAddFrame itself will extend the environment with the new (vars, values). But this is odd, because openNode calls vcAddFrame apparently with the *new* environment as prevEnv, and yet it works correctly.

Caution: I think it is necessary for the canvas to have been realized before calling this function!

vcClearSelection :: VCanvas -> IO VCanvasSource

Make nothing be selected

vcClearFrame :: VCanvas -> CanvFrame -> IO VCanvasSource

vcClearFrame - clear a frame in a canvas; not yet implemented What does this mean?

vcCloseFrame :: VCanvas -> CanvFrame -> IO VCanvasSource

Close a frame and any subframes of it

vcFrameDeleteTree :: VCanvas -> CanvFrame -> Node -> IO VCanvasSource

Remove the (sub)tree rooted at the given node. Removes it from the graph of the canvas and from the FunctoidParts of the frame.

vcFrameSubframes :: VCanvas -> CanvFrame -> [CanvFrame]Source

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.

vcUpdateFrameAndGraph :: VCanvas -> CanvFrame -> WGraph -> VCanvasSource

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.

vcanvasNodeAt :: VCanvas -> Position -> Maybe NodeSource

Find the node, if any, at a given position on the canvas.

callFrames :: VCanvas -> String -> [CanvFrame]Source

Find the frames that are calling the named function