Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- type NestedSets a = [NestedSetsNode a]
- type Position = (Int, Int)
- data NestedSetsNode a = NestedSetsNode {
- position :: Position
- content :: a
- children :: NestedSets a
- forestToNestedSets :: Forest a -> NestedSets a
- nestedSetsToForest :: NestedSets a -> Forest a
- nestedSetsStartPosition :: NestedSets a -> Maybe Position
- nestedSetsNextSiblingPosition :: NestedSets a -> Position -> Maybe Position
- nestedSetsParentPosition :: NestedSets a -> Position -> Maybe Position
- nestedSetsFirstChildPosition :: NestedSets a -> Position -> Maybe Position
- nestedSetsPositionValue :: NestedSets a -> Position -> Maybe a
- nestedSetsPositionSetValue :: NestedSets a -> Position -> a -> NestedSets a
- isNestedSetsPositionParent :: Position -> Position -> Bool
Documentation
type NestedSets a = [NestedSetsNode a] Source
data NestedSetsNode a Source
NestedSetsNode | |
|
Eq a => Eq (NestedSetsNode a) | |
Show a => Show (NestedSetsNode a) |
forestToNestedSets :: Forest a -> NestedSets a Source
Convert forest to nested sets
This function is the opposite of nestedSetsToForest
nestedSetsToForest :: NestedSets a -> Forest a Source
Convert nested sets to forest.
This function is the opposite of forestToNestedSets
nestedSetsStartPosition :: NestedSets a -> Maybe Position Source
Retrieve the starting position (iterator) of the nested set.
nestedSetsNextSiblingPosition :: NestedSets a -> Position -> Maybe Position Source
Advance the given position to the next sibling.
nestedSetsParentPosition :: NestedSets a -> Position -> Maybe Position Source
Retrieve the position's parent position.
nestedSetsFirstChildPosition :: NestedSets a -> Position -> Maybe Position Source
Advance the position to the first child node.
nestedSetsPositionValue :: NestedSets a -> Position -> Maybe a Source
Retrieve the value for the given Position
.
nestedSetsPositionSetValue :: NestedSets a -> Position -> a -> NestedSets a Source
Set value for the Position
on the given nested set.
Does not modify the given NestedSets
if the Position
cannot be found.
isNestedSetsPositionParent :: Position -> Position -> Bool Source