hexpat-0.20.13: XML parser/formatter based on expat

Safe Haskell | None
Language | Haskell98

Text.XML.Expat.Cursor

Contents

- Types
- Conversions
- Moving around
  - Searching
- Node classification
- Updates
  - Inserting content
  - Removing content

Description

This module ported from Text.XML.Light.Cursor

XML cursors for working XML content withing the context of an XML document. This implementation is based on the general tree zipper written by Krasimir Angelov and Iavor S. Diatchki.

With the exception of `modifyContentM`, then M-suffixed functions are for use with monadic node types, as used when dealing with chunked I/O with the hexpat-iteratee package. In the more common pure case, you wouldn't need these *M functions.

Synopsis

- type Cursor tag text = CursorG NodeG [] tag text
- data CursorG (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text = Cur {
  - current :: n c tag text
  - lefts :: c (n c tag text)
  - rights :: c (n c tag text)
  - parents :: PathG n c tag text
  }
- type Path tag text = PathG NodeG [] tag text
- type PathG (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text = [(c (n c tag text), Tag tag text, c (n c tag text))]
- data Tag tag text = Tag {
  - tagName :: tag
  - tagAttribs :: Attributes tag text
  }
- getTag :: Node tag text -> Tag tag text
- fromTag :: MkElementClass n c => Tag tag text -> c (n c tag text) -> n c tag text
- fromTree :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text
- fromForest :: NodeClass n [] => [n [] tag text] -> Maybe (CursorG n [] tag text)
- toForest :: MkElementClass n c => CursorG n c tag text -> c (n c tag text)
- toTree :: forall n (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> n c tag text
- parent :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> Maybe (CursorG n c tag text)
- root :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> CursorG n c tag text
- getChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => Int -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- getChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => Int -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- firstChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- firstChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- lastChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- lastChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- left :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- leftM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- right :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- rightM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- nextDF :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (MkElementClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- nextDFM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (MkElementClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- findChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- findLeft :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. NodeClass n [] => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- findRight :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- findRec :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (MkElementClass n [], Monoid tag) => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- findRecM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (MkElementClass n c, Monoid tag) => (CursorG n c tag text -> ItemM c Bool) -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- isRoot :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. CursorG n c tag text -> Bool
- isFirst :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Bool
- isFirstM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c Bool
- isLast :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Bool
- isLastM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c Bool
- isLeaf :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> Bool
- isChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. CursorG n c tag text -> Bool
- hasChildren :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> Bool
- getNodeIndex :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Int
- setContent :: forall n (c :: Type -> Type) tag text. n c tag text -> CursorG n c tag text -> CursorG n c tag text
- modifyContent :: forall n (c :: Type -> Type) tag text. (n c tag text -> n c tag text) -> CursorG n c tag text -> CursorG n c tag text
- modifyContentList :: NodeClass n [] => (n [] tag text -> [n [] tag text]) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- modifyContentListM :: NodeClass n c => (n c tag text -> c (n c tag text)) -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- modifyContentM :: Monad m => (n [] tag text -> m (n [] tag text)) -> CursorG n [] tag text -> m (CursorG n [] tag text)
- insertLeft :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text
- insertRight :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text
- insertManyLeft :: List c => c (n c tag text) -> CursorG n c tag text -> CursorG n c tag text
- insertManyRight :: List c => c (n c tag text) -> CursorG n c tag text -> CursorG n c tag text
- insertFirstChild :: forall n (c :: Type -> Type) tag text. NodeClass n c => n c tag text -> CursorG n c tag text -> Maybe (CursorG n c tag text)
- insertLastChild :: forall n (c :: Type -> Type) tag text. NodeClass n c => n c tag text -> CursorG n c tag text -> Maybe (CursorG n c tag text)
- insertManyFirstChild :: NodeClass n c => c (n c tag text) -> CursorG n c tag text -> Maybe (CursorG n c tag text)
- insertManyLastChild :: NodeClass n c => c (n c tag text) -> CursorG n c tag text -> Maybe (CursorG n c tag text)
- insertGoLeft :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text
- insertGoRight :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text
- removeLeft :: CursorG n [] tag text -> Maybe (n [] tag text, CursorG n [] tag text)
- removeLeftM :: forall (c :: Type -> Type) n tag text. List c => CursorG n c tag text -> ItemM c (Maybe (n c tag text, CursorG n c tag text))
- removeRight :: CursorG n [] tag text -> Maybe (n [] tag text, CursorG n [] tag text)
- removeRightM :: forall (c :: Type -> Type) n tag text. List c => CursorG n c tag text -> ItemM c (Maybe (n c tag text, CursorG n c tag text))
- removeGoLeft :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- removeGoLeftM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- removeGoRight :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text)
- removeGoRightM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text))
- removeGoUp :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> Maybe (CursorG n c tag text)

# Types

type Cursor tag text = CursorG NodeG [] tag text Source #

A cursor specific to `Text.XML.Expat.Tree.Node` trees.

data CursorG (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text Source #

Generalized cursor: The position of a piece of content in an XML document. `n` is the Node type and `c` is the list type, which would usually be [], except when you're using chunked I/O.

Constructors

Cur |

Fields

- current :: n c tag text

  The currently selected content.

- lefts :: c (n c tag text)

  Siblings on the left, closest first.

- rights :: c (n c tag text)

  Siblings on the right, closest first.

- parents :: PathG n c tag text

  The contexts of the parent elements of this location.

#### Instances

Instances details

(Show (n c tag text), Show (c (n c tag text)), Show tag, Show text) => Show (CursorG n c tag text) Source # |
Instance details Defined in Text.XML.Expat.Cursor Methods showsPrec :: Int -> CursorG n c tag text -> ShowS Source # show :: CursorG n c tag text -> String Source # showList :: [CursorG n c tag text] -> ShowS Source #

type Path tag text = PathG NodeG [] tag text Source #

A path specific to `Text.XML.Expat.Tree.Node` trees.

type PathG (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text = [(c (n c tag text), Tag tag text, c (n c tag text))] Source #

Generalized path within an XML document.

data Tag tag text Source #

Constructors

Tag |

Fields

- tagName :: tag
- tagAttribs :: Attributes tag text

#### Instances

Instances details

(Show tag, Show text) => Show (Tag tag text) Source # |
Instance details Defined in Text.XML.Expat.Cursor Methods showsPrec :: Int -> Tag tag text -> ShowS Source # show :: Tag tag text -> String Source # showList :: [Tag tag text] -> ShowS Source #

getTag :: Node tag text -> Tag tag text Source #

fromTag :: MkElementClass n c => Tag tag text -> c (n c tag text) -> n c tag text Source #

# Conversions

fromTree :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text Source #

A cursor for the given content.

fromForest :: NodeClass n [] => [n [] tag text] -> Maybe (CursorG n [] tag text) Source #

The location of the first tree in a forest - pure version.

toForest :: MkElementClass n c => CursorG n c tag text -> c (n c tag text) Source #

Computes the forest containing this location.

toTree :: forall n (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> n c tag text Source #

Computes the tree containing this location.

# Moving around

parent :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

The parent of the given location.

root :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> CursorG n c tag text Source #

The top-most parent of the given location.

getChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => Int -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The child with the given index (starting from 0). - pure version.

getChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => Int -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The child with the given index (starting from 0) - used for monadic node types.

firstChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The first child of the given location - pure version.

firstChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The first child of the given location - used for monadic node types.

lastChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The last child of the given location - pure version.

lastChildM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The last child of the given location - used for monadic node types.

left :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The left sibling of the given location - pure version.

leftM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The left sibling of the given location - used for monadic node types.

right :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The right sibling of the given location - pure version.

rightM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The right sibling of the given location - used for monadic node types.

nextDF :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (MkElementClass n [], Monoid tag) => CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The next position in a left-to-right depth-first traversal of a document: either the first child, right sibling, or the right sibling of a parent that has one. Pure version.

nextDFM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (MkElementClass n c, Monoid tag) => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

The next position in a left-to-right depth-first traversal of a document: either the first child, right sibling, or the right sibling of a parent that has one. Used for monadic node types.

## Searching

findChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (NodeClass n [], Monoid tag) => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

The first child that satisfies a predicate - pure version.

findLeft :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. NodeClass n [] => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Find the next left sibling that satisfies a predicate.

findRight :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Find the next right sibling that satisfies a predicate - pure version.

findRec :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. (MkElementClass n [], Monoid tag) => (CursorG n [] tag text -> Bool) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Perform a depth first search for a descendant that satisfies the given predicate. Pure version.

findRecM :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (MkElementClass n c, Monoid tag) => (CursorG n c tag text -> ItemM c Bool) -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

Perform a depth first search for a descendant that satisfies the given predicate. Used for monadic node types.

# Node classification

isRoot :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. CursorG n c tag text -> Bool Source #

Are we at the top of the document?

isFirst :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Bool Source #

Are we at the left end of the the document? (Pure version.)

isFirstM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c Bool Source #

Are we at the left end of the the document? (Used for monadic node types.)

isLast :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Bool Source #

Are we at the right end of the document? (Pure version.)

isLastM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c Bool Source #

Are we at the right end of the document? (Used for monadic node types.)

isLeaf :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> Bool Source #

Are we at the bottom of the document?

isChild :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. CursorG n c tag text -> Bool Source #

Do we have a parent?

hasChildren :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. (NodeClass n c, Monoid tag) => CursorG n c tag text -> Bool Source #

Do we have children?

getNodeIndex :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Int Source #

Get the node index inside the sequence of children - pure version.

# Updates

setContent :: forall n (c :: Type -> Type) tag text. n c tag text -> CursorG n c tag text -> CursorG n c tag text Source #

Change the current content.

modifyContent :: forall n (c :: Type -> Type) tag text. (n c tag text -> n c tag text) -> CursorG n c tag text -> CursorG n c tag text Source #

Modify the current content.

modifyContentList :: NodeClass n [] => (n [] tag text -> [n [] tag text]) -> CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Modify the current content - pure version.

modifyContentListM :: NodeClass n c => (n c tag text -> c (n c tag text)) -> CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

Modify the current content - used for monadic node types.

modifyContentM :: Monad m => (n [] tag text -> m (n [] tag text)) -> CursorG n [] tag text -> m (CursorG n [] tag text) Source #

Modify the current content, allowing for an effect.

## Inserting content

insertLeft :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the left of the current position.

insertRight :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the right of the current position.

insertManyLeft :: List c => c (n c tag text) -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the left of the current position.

insertManyRight :: List c => c (n c tag text) -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the right of the current position.

insertFirstChild :: forall n (c :: Type -> Type) tag text. NodeClass n c => n c tag text -> CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

Insert content as the first child of the current position.

insertLastChild :: forall n (c :: Type -> Type) tag text. NodeClass n c => n c tag text -> CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

Insert content as the first child of the current position.

insertManyFirstChild :: NodeClass n c => c (n c tag text) -> CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

Insert content as the first child of the current position.

insertManyLastChild :: NodeClass n c => c (n c tag text) -> CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

Insert content as the first child of the current position.

insertGoLeft :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the left of the current position. The new content becomes the current position.

insertGoRight :: forall (c :: Type -> Type) n tag text. List c => n c tag text -> CursorG n c tag text -> CursorG n c tag text Source #

Insert content to the right of the current position. The new content becomes the current position.

## Removing content

removeLeft :: CursorG n [] tag text -> Maybe (n [] tag text, CursorG n [] tag text) Source #

Remove the content on the left of the current position, if any - pure version.

removeLeftM :: forall (c :: Type -> Type) n tag text. List c => CursorG n c tag text -> ItemM c (Maybe (n c tag text, CursorG n c tag text)) Source #

Remove the content on the left of the current position, if any - used for monadic node types.

removeRight :: CursorG n [] tag text -> Maybe (n [] tag text, CursorG n [] tag text) Source #

Remove the content on the right of the current position, if any - pure version.

removeRightM :: forall (c :: Type -> Type) n tag text. List c => CursorG n c tag text -> ItemM c (Maybe (n c tag text, CursorG n c tag text)) Source #

Remove the content on the left of the current position, if any - used for monadic node types.

removeGoLeft :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Remove the current element. The new position is the one on the left. Pure version.

removeGoLeftM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

Remove the current element. The new position is the one on the left. Pure version.

removeGoRight :: forall (n :: (Type -> Type) -> Type -> Type -> Type) tag text. CursorG n [] tag text -> Maybe (CursorG n [] tag text) Source #

Remove the current element. The new position is the one on the right. Pure version.

removeGoRightM :: forall (c :: Type -> Type) (n :: (Type -> Type) -> Type -> Type -> Type) tag text. List c => CursorG n c tag text -> ItemM c (Maybe (CursorG n c tag text)) Source #

Remove the current element. The new position is the one on the right. Used for monadic node types.

removeGoUp :: forall (n :: (Type -> Type) -> Type -> Type -> Type) (c :: Type -> Type) tag text. MkElementClass n c => CursorG n c tag text -> Maybe (CursorG n c tag text) Source #

Remove the current element. The new position is the parent of the old position.