Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type TreeCursor a = TreeCursor a a
- data TreeAbove b = TreeAbove {
- treeAboveLefts :: ![CTree b]
- treeAboveAbove :: !(Maybe (TreeAbove b))
- treeAboveNode :: !b
- treeAboveRights :: ![CTree b]
- singletonTreeCursor :: a -> TreeCursor a
- makeTreeCursor :: CTree a -> TreeCursor a
- makeNodeTreeCursor :: a -> CForest b -> TreeCursor a b
- makeTreeCursorWithSelection :: TreeCursorSelection -> CTree a -> Maybe (TreeCursor a)
- rebuildTreeCursor :: TreeCursor a -> CTree a
- drawTreeCursor :: (Show a, Show b) => TreeCursor a b -> String
- mapTreeCursor :: (a -> b) -> TreeCursor a -> TreeCursor b
- treeCursorAboveL :: Lens' (TreeCursor a b) (Maybe (TreeAbove b))
- treeCursorCurrentL :: Lens (TreeCursor a b) (TreeCursor a' b) a a'
- treeCursorBelowL :: Lens' (TreeCursor a b) (CForest b)
- treeAboveLeftsL :: Lens' (TreeAbove b) [CTree b]
- treeAboveAboveL :: Lens' (TreeAbove b) (Maybe (TreeAbove b))
- treeAboveNodeL :: Lens' (TreeAbove b) b
- treeAboveRightsL :: Lens' (TreeAbove b) [CTree b]
- treeCursorWithPointer :: (Show a, Show b) => TreeCursor a b -> Tree String
- treeCursorSelection :: TreeCursor a b -> TreeCursorSelection
- data TreeCursorSelection
- treeCursorSelect :: TreeCursorSelection -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectPrev :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectNext :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectFirst :: TreeCursor a -> TreeCursor a
- treeCursorSelectLast :: TreeCursor a -> TreeCursor a
- treeCursorSelectAbove :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectBelowAtPos :: Int -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectBelowAtStart :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectBelowAtEnd :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectBelowAtStartRecursively :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectBelowAtEndRecursively :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectPrevOnSameLevel :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectNextOnSameLevel :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectFirstOnSameLevel :: TreeCursor a -> TreeCursor a
- treeCursorSelectLastOnSameLevel :: TreeCursor a -> TreeCursor a
- treeCursorSelectAbovePrev :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorSelectAboveNext :: TreeCursor a -> Maybe (TreeCursor a)
- treeCursorOpenCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorCloseCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorToggleCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorOpenCurrentForestRecursively :: TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorToggleCurrentForestRecursively :: TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorInsert :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorInsertAndSelect :: Tree a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorInsertNodeSingleAndSelect :: a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorInsertNodeAndSelect :: a -> CForest a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorAppend :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorAppendAndSelect :: Tree a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorAppendNodeSingleAndSelect :: a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorAppendNodeAndSelect :: a -> CForest a -> TreeCursor a -> Maybe (TreeCursor a)
- treeCursorAddChildAtPos :: Int -> Tree b -> TreeCursor a b -> TreeCursor a b
- treeCursorAddChildAtStart :: Tree b -> TreeCursor a b -> TreeCursor a b
- treeCursorAddChildAtEnd :: Tree b -> TreeCursor a b -> TreeCursor a b
- treeCursorAddChildAtPosAndSelect :: Int -> Tree a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildAtStartAndSelect :: Tree a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildAtEndAndSelect :: Tree a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeSingleAtPosAndSelect :: Int -> a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeSingleAtStartAndSelect :: a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeSingleAtEndAndSelect :: a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeAtPosAndSelect :: Int -> a -> Forest a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeAtStartAndSelect :: a -> Forest a -> TreeCursor a -> TreeCursor a
- treeCursorAddChildNodeAtEndAndSelect :: a -> Forest a -> TreeCursor a -> TreeCursor a
- treeCursorDeleteSubTreeAndSelectPrevious :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a))
- treeCursorDeleteSubTreeAndSelectNext :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a))
- treeCursorDeleteSubTreeAndSelectAbove :: TreeCursor a -> DeleteOrUpdate (TreeCursor a)
- treeCursorRemoveSubTree :: TreeCursor a -> DeleteOrUpdate (TreeCursor a)
- treeCursorDeleteSubTree :: TreeCursor a -> DeleteOrUpdate (TreeCursor a)
- treeCursorDeleteElemAndSelectPrevious :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a))
- treeCursorDeleteElemAndSelectNext :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a))
- treeCursorDeleteElemAndSelectAbove :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a))
- treeCursorRemoveElem :: TreeCursor a -> DeleteOrUpdate (TreeCursor a)
- treeCursorDeleteElem :: TreeCursor a -> DeleteOrUpdate (TreeCursor a)
- treeCursorSwapPrev :: TreeCursor a b -> SwapResult (TreeCursor a b)
- treeCursorSwapNext :: TreeCursor a b -> SwapResult (TreeCursor a b)
- data SwapResult a
- treeCursorPromoteElem :: TreeCursor a -> PromoteElemResult (TreeCursor a)
- data PromoteElemResult a
- treeCursorPromoteSubTree :: TreeCursor a -> PromoteResult (TreeCursor a)
- data PromoteResult a
- treeCursorDemoteElem :: TreeCursor a -> DemoteResult (TreeCursor a)
- treeCursorDemoteSubTree :: TreeCursor a -> DemoteResult (TreeCursor a)
- data DemoteResult a
- treeCursorDemoteElemUnder :: b -> b -> TreeCursor a b -> Maybe (TreeCursor a b)
- treeCursorDemoteSubTreeUnder :: b -> TreeCursor a b -> TreeCursor a b
- data CTree a = CNode !a (CForest a)
- data CForest a
- makeCTree :: Tree a -> CTree a
- cTree :: Bool -> Tree a -> CTree a
- rebuildCTree :: CTree a -> Tree a
Documentation
type TreeCursor a = TreeCursor a a Source #
TreeAbove | |
|
Instances
Functor TreeAbove Source # | |
Eq b => Eq (TreeAbove b) Source # | |
Show b => Show (TreeAbove b) Source # | |
Generic (TreeAbove b) Source # | |
NFData b => NFData (TreeAbove b) Source # | |
Defined in Cursor.Tree.Types | |
Validity b => Validity (TreeAbove b) Source # | |
Defined in Cursor.Tree.Types validate :: TreeAbove b -> Validation # | |
type Rep (TreeAbove b) Source # | |
Defined in Cursor.Tree.Types type Rep (TreeAbove b) = D1 ('MetaData "TreeAbove" "Cursor.Tree.Types" "cursor-0.3.2.0-Ch3lJwc3yY89mrJgbt03T" 'False) (C1 ('MetaCons "TreeAbove" 'PrefixI 'True) ((S1 ('MetaSel ('Just "treeAboveLefts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [CTree b]) :*: S1 ('MetaSel ('Just "treeAboveAbove") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe (TreeAbove b)))) :*: (S1 ('MetaSel ('Just "treeAboveNode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just "treeAboveRights") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [CTree b])))) |
singletonTreeCursor :: a -> TreeCursor a Source #
makeTreeCursor :: CTree a -> TreeCursor a Source #
makeNodeTreeCursor :: a -> CForest b -> TreeCursor a b Source #
makeTreeCursorWithSelection :: TreeCursorSelection -> CTree a -> Maybe (TreeCursor a) Source #
rebuildTreeCursor :: TreeCursor a -> CTree a Source #
drawTreeCursor :: (Show a, Show b) => TreeCursor a b -> String Source #
mapTreeCursor :: (a -> b) -> TreeCursor a -> TreeCursor b Source #
treeCursorAboveL :: Lens' (TreeCursor a b) (Maybe (TreeAbove b)) Source #
treeCursorCurrentL :: Lens (TreeCursor a b) (TreeCursor a' b) a a' Source #
treeCursorBelowL :: Lens' (TreeCursor a b) (CForest b) Source #
treeAboveNodeL :: Lens' (TreeAbove b) b Source #
treeCursorWithPointer :: (Show a, Show b) => TreeCursor a b -> Tree String Source #
treeCursorSelection :: TreeCursor a b -> TreeCursorSelection Source #
data TreeCursorSelection Source #
Instances
treeCursorSelect :: TreeCursorSelection -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectPrev :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectNext :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectFirst :: TreeCursor a -> TreeCursor a Source #
treeCursorSelectLast :: TreeCursor a -> TreeCursor a Source #
treeCursorSelectAbove :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectBelowAtPos :: Int -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectBelowAtStart :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectBelowAtEnd :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectPrevOnSameLevel :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectNextOnSameLevel :: TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorSelectAbovePrev :: TreeCursor a -> Maybe (TreeCursor a) Source #
Go back and down as far as necessary to find a previous element on a level below
treeCursorSelectAboveNext :: TreeCursor a -> Maybe (TreeCursor a) Source #
Go up as far as necessary to find a next element on a level above and forward
Note: This will fail if there is a next node on the same level or any node below the current node
treeCursorOpenCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorCloseCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorToggleCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorOpenCurrentForestRecursively :: TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorToggleCurrentForestRecursively :: TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorInsert :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorInsertAndSelect :: Tree a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorInsertNodeSingleAndSelect :: a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorInsertNodeAndSelect :: a -> CForest a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorAppend :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) Source #
treeCursorAppendAndSelect :: Tree a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorAppendNodeSingleAndSelect :: a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorAppendNodeAndSelect :: a -> CForest a -> TreeCursor a -> Maybe (TreeCursor a) Source #
treeCursorAddChildAtPos :: Int -> Tree b -> TreeCursor a b -> TreeCursor a b Source #
treeCursorAddChildAtStart :: Tree b -> TreeCursor a b -> TreeCursor a b Source #
treeCursorAddChildAtEnd :: Tree b -> TreeCursor a b -> TreeCursor a b Source #
treeCursorAddChildAtPosAndSelect :: Int -> Tree a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildAtStartAndSelect :: Tree a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildAtEndAndSelect :: Tree a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeSingleAtPosAndSelect :: Int -> a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeSingleAtStartAndSelect :: a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeSingleAtEndAndSelect :: a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeAtPosAndSelect :: Int -> a -> Forest a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeAtStartAndSelect :: a -> Forest a -> TreeCursor a -> TreeCursor a Source #
treeCursorAddChildNodeAtEndAndSelect :: a -> Forest a -> TreeCursor a -> TreeCursor a Source #
treeCursorDeleteSubTreeAndSelectPrevious :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a)) Source #
treeCursorDeleteSubTreeAndSelectNext :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a)) Source #
treeCursorRemoveSubTree :: TreeCursor a -> DeleteOrUpdate (TreeCursor a) Source #
treeCursorDeleteSubTree :: TreeCursor a -> DeleteOrUpdate (TreeCursor a) Source #
treeCursorDeleteElemAndSelectPrevious :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a)) Source #
treeCursorDeleteElemAndSelectNext :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a)) Source #
treeCursorDeleteElemAndSelectAbove :: TreeCursor a -> Maybe (DeleteOrUpdate (TreeCursor a)) Source #
treeCursorRemoveElem :: TreeCursor a -> DeleteOrUpdate (TreeCursor a) Source #
treeCursorDeleteElem :: TreeCursor a -> DeleteOrUpdate (TreeCursor a) Source #
treeCursorSwapPrev :: TreeCursor a b -> SwapResult (TreeCursor a b) Source #
Swaps the current node with the previous node on the same level
Example:
Before:
p |- a |- b <--
After:
p |- b <-- |- a
treeCursorSwapNext :: TreeCursor a b -> SwapResult (TreeCursor a b) Source #
Swaps the current node with the next node on the same level
Example:
Before:
p |- a <-- |- b
After:
p |- b |- a <--
data SwapResult a Source #
Instances
treeCursorPromoteElem :: TreeCursor a -> PromoteElemResult (TreeCursor a) Source #
data PromoteElemResult a Source #
Instances
treeCursorPromoteSubTree :: TreeCursor a -> PromoteResult (TreeCursor a) Source #
data PromoteResult a Source #
Instances
treeCursorDemoteElem :: TreeCursor a -> DemoteResult (TreeCursor a) Source #
treeCursorDemoteSubTree :: TreeCursor a -> DemoteResult (TreeCursor a) Source #
data DemoteResult a Source #
Instances
treeCursorDemoteElemUnder :: b -> b -> TreeCursor a b -> Maybe (TreeCursor a b) Source #
Demotes the current node to the level of its children, by adding two roots. One for the current node and one for its children that are left behind.
Example:
Before:
p |- a <-- |- b
After:
p |- <given element 1> | |- a <-- |- <given element 2> | |- b
treeCursorDemoteSubTreeUnder :: b -> TreeCursor a b -> TreeCursor a b Source #
Demotes the current subtree to the level of its children, by adding a root.
Example:
Before:
a <-- |- b
After:
<given element> |- a <-- |- b
Instances
Instances
rebuildCTree :: CTree a -> Tree a Source #