Copyright | (c) Dominik Schrempf 2020 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Jul 23 08:42:37 2020.
Synopsis
- data TreePos e a = Pos {}
- fromTree :: Tree e a -> TreePos e a
- toTree :: TreePos e a -> Tree e a
- goUp :: TreePos e a -> Maybe (TreePos e a)
- goRoot :: TreePos e a -> TreePos e a
- goLeft :: TreePos e a -> Maybe (TreePos e a)
- goRight :: TreePos e a -> Maybe (TreePos e a)
- goChild :: Int -> TreePos e a -> Maybe (TreePos e a)
- goPath :: [Int] -> TreePos e a -> Maybe (TreePos e a)
- unsafeGoPath :: [Int] -> TreePos e a -> TreePos e a
- insertTree :: Tree e a -> TreePos e a -> TreePos e a
- insertBranch :: e -> TreePos e a -> TreePos e a
- insertLabel :: a -> TreePos e a -> TreePos e a
Data type
Tree zipper. For reference, please see http://hackage.haskell.org/package/rosezipper.
Conversion
Movement
goChild :: Int -> TreePos e a -> Maybe (TreePos e a) Source #
Go to child with given index in forest.
unsafeGoPath :: [Int] -> TreePos e a -> TreePos e a Source #
Got to node with given path. Call error
if path is invalid.
Modification
insertTree :: Tree e a -> TreePos e a -> TreePos e a Source #
Insert a new tree into the current focus of the zipper.
insertBranch :: e -> TreePos e a -> TreePos e a Source #
Insert a new branch label into the current focus of the zipper.
insertLabel :: a -> TreePos e a -> TreePos e a Source #
Insert a new node label into the current focus of the zipper.