ยค drawingPart, DPath, et al

Drawing manipulation

Types

drawingPart :: Drawing lbl leaf -> [Int] -> Drawing lbl leaf
type DPath = [Int]

up :: DPath -> DPath
maybeDrawingPart :: Drawing lbl leaf -> [Int] -> Maybe (Drawing lbl leaf)
replacePart :: Drawing lbl leaf -> [Int] -> Drawing lbl leaf -> Drawing lbl leaf
updatePart :: Drawing lbl leaf ->
              [Int] -> (Drawing lbl leaf -> Drawing lbl leaf) -> Drawing lbl leaf
mapLabelDrawing :: (t -> lbl) -> Drawing t leaf -> Drawing lbl leaf
deletePart :: Drawing lbl leaf -> [Int] -> Drawing lbl leaf
drawingAnnots :: Drawing a leaf -> [(DPath, a)]

Description

These are functions that operate on parts of drawings.

Values of type DPath are used as references to parts of drawings. The function up returns the path of the parent of a node.

There are two functions for extracting a part with a given path. The function drawingPart fails if the path refers to a non-existing part. maybeDrawingPart returns Just part if the part exists, Nothing otherwise.

The functions replacePart and updatePart replace parts of drawings. They fail if the path refers to a non-existing part.

mapLabelDrawing applies a function to all the labels in a drawing.

deletePart deletes a part of a drawing.

drawingAnnots returns the paths and labels of the labelled nodes of a drawing.

Equalities

replacePart drawing path newpart = updatePart drawing path (const newpart)

See Also

The types: Drawing, DPath.

Bugs

This page documents work progress. Information on this page is subject to change without notice and does not represent a commitment on the part of the Fudgets corporation.