License | GNU LGPLv3 |
---|---|
Maintainer | paul.bittner@uni-ulm.de |
Safe Haskell | Safe |
Synopsis
- data EditType
- data Edit g a = Edit {}
- type EditScript g a = [Edit g a]
- foldEditScript :: EditScript g a -> AST g a -> AST g a
- edit_identity :: Edit g a
- edit_trace_only :: Set (Node g a) -> Edit g a
- edit_ins_tree :: Eq a => AST g a -> UUID -> Int -> Edit g a
- edit_del_node :: Eq a => UUID -> Edit g a
- edit_del_tree :: Eq a => UUID -> Edit g a
- edit_move_tree :: (Grammar g, Eq a, Show a) => UUID -> UUID -> Int -> Edit g a
- edit_update :: (Grammar g, Show a, Eq a) => UUID -> g -> a -> Edit g a
Documentation
Each edit is associated to a type depending on what it does.
Identity |
|
TraceOnly |
|
Insert |
|
Delete |
|
Move |
|
Update |
|
An edit to an AST.
Edit | |
|
type EditScript g a = [Edit g a] Source #
An EditScript
is a sequence of edits that should be applied in order to a single AST.
foldEditScript :: EditScript g a -> AST g a -> AST g a Source #
Runs an entire edit script on a given AST. If curried, turns an edit script into one single function that can run that script on any AST.
edit_identity :: Edit g a Source #
The identity of edits. Does nothing and has an empty delta for all trees.
edit_trace_only :: Set (Node g a) -> Edit g a Source #
An identity edit that will keep the given set of nodes as delta for the feature trace recording. Upon recording, all given nodes will have their feature trace changed to the feature context. This function assumes that the given set of nodes is a subset of the nodes in the future edited tree.
edit_ins_tree :: Eq a => AST g a -> UUID -> Int -> Edit g a Source #
Inserts a subtree into another tree.
The given tree (first argument) will become the i
-th child of the node with the given UUID.
edit_del_node :: Eq a => UUID -> Edit g a Source #
Delete the node with the given UUID v and move its children up (such that they become children of the deleted node's parent).
edit_del_tree :: Eq a => UUID -> Edit g a Source #
Delete the entire subtree whose root has the given id.