-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Nested set model implementation -- @package nested-sets @version 0.0.1.0 module Data.NestedSet type NestedSets a = [NestedSetsNode a] type Position = (Int, Int) data NestedSetsNode a NestedSetsNode :: Position -> a -> NestedSets a -> NestedSetsNode a position :: NestedSetsNode a -> Position content :: NestedSetsNode a -> a children :: NestedSetsNode a -> NestedSets a -- | Convert forest to nested sets This function is the opposite of -- nestedSetsToForest forestToNestedSets :: Forest a -> NestedSets a -- | Convert nested sets to forest. This function is the opposite of -- forestToNestedSets nestedSetsToForest :: NestedSets a -> Forest a -- | Retrieve the starting position (iterator) of the nested set. nestedSetsStartPosition :: NestedSets a -> Maybe Position -- | Advance the given position to the next sibling. nestedSetsNextSiblingPosition :: NestedSets a -> Position -> Maybe Position -- | Retrieve the position's parent position. nestedSetsParentPosition :: NestedSets a -> Position -> Maybe Position -- | Advance the position to the first child node. nestedSetsFirstChildPosition :: NestedSets a -> Position -> Maybe Position -- | Retrieve the value for the given Position. nestedSetsPositionValue :: NestedSets a -> Position -> Maybe a instance Show a => Show (NestedSetsNode a) instance Eq a => Eq (NestedSetsNode a)