-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Purely Functional Cursors -- -- Purely Functional Cursors for common data structures @package cursor @version 0.0.0.1 module Cursor.List data ListCursor a ListCursor :: [a] -> [a] -> ListCursor a -- | In reverse order [listCursorPrev] :: ListCursor a -> [a] [listCursorNext] :: ListCursor a -> [a] emptyListCursor :: ListCursor a makeListCursor :: [a] -> ListCursor a makeListCursorWithSelection :: Int -> [a] -> Maybe (ListCursor a) rebuildListCursor :: ListCursor a -> [a] listCursorNull :: ListCursor a -> Bool listCursorLength :: ListCursor a -> Int listCursorIndex :: ListCursor a -> Int listCursorSelectPrev :: ListCursor a -> Maybe (ListCursor a) listCursorSelectNext :: ListCursor a -> Maybe (ListCursor a) listCursorSelectIndex :: Int -> ListCursor a -> ListCursor a listCursorSelectStart :: ListCursor a -> ListCursor a listCursorSelectEnd :: ListCursor a -> ListCursor a listCursorPrevItem :: ListCursor a -> Maybe a listCursorNextItem :: ListCursor a -> Maybe a listCursorInsert :: a -> ListCursor a -> ListCursor a listCursorAppend :: a -> ListCursor a -> ListCursor a listCursorRemove :: ListCursor a -> Maybe (ListCursor a) listCursorDelete :: ListCursor a -> Maybe (ListCursor a) listCursorSplit :: ListCursor a -> (ListCursor a, ListCursor a) listCursorCombine :: ListCursor a -> ListCursor a -> ListCursor a instance GHC.Base.Functor Cursor.List.ListCursor instance GHC.Generics.Generic (Cursor.List.ListCursor a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.List.ListCursor a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.List.ListCursor a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.List.ListCursor a) module Cursor.Map.KeyValue data KeyValueCursor kc vc k v KeyValueCursorKey :: kc -> v -> KeyValueCursor kc vc k v KeyValueCursorValue :: k -> vc -> KeyValueCursor kc vc k v makeKeyValueCursorKey :: kc -> v -> KeyValueCursor kc vc k v makeKeyValueCursorValue :: k -> vc -> KeyValueCursor kc vc k v rebuildKeyValueCursor :: (kc -> k) -> (vc -> v) -> KeyValueCursor kc vc k v -> (k, v) keyValueCursorSelection :: KeyValueCursor kc vc k v -> KeyValueToggle mapKeyValueCursor :: (kc -> lc) -> (vc -> wc) -> (k -> l) -> (v -> w) -> KeyValueCursor kc vc k v -> KeyValueCursor lc wc l w keyValueCursorSelectKey :: (k -> kc) -> (vc -> v) -> KeyValueCursor kc vc k v -> KeyValueCursor kc vc k v keyValueCursorSelectValue :: (kc -> k) -> (v -> vc) -> KeyValueCursor kc vc k v -> KeyValueCursor kc vc k v keyValueCursorToggleSelected :: (kc -> k) -> (k -> kc) -> (vc -> v) -> (v -> vc) -> KeyValueCursor kc vc k v -> KeyValueCursor kc vc k v data KeyValueToggle KeySelected :: KeyValueToggle ValueSelected :: KeyValueToggle instance GHC.Generics.Generic Cursor.Map.KeyValue.KeyValueToggle instance GHC.Classes.Eq Cursor.Map.KeyValue.KeyValueToggle instance GHC.Show.Show Cursor.Map.KeyValue.KeyValueToggle instance GHC.Generics.Generic (Cursor.Map.KeyValue.KeyValueCursor kc vc k v) instance (GHC.Classes.Eq kc, GHC.Classes.Eq v, GHC.Classes.Eq k, GHC.Classes.Eq vc) => GHC.Classes.Eq (Cursor.Map.KeyValue.KeyValueCursor kc vc k v) instance (GHC.Show.Show kc, GHC.Show.Show v, GHC.Show.Show k, GHC.Show.Show vc) => GHC.Show.Show (Cursor.Map.KeyValue.KeyValueCursor kc vc k v) instance Data.Validity.Validity Cursor.Map.KeyValue.KeyValueToggle instance (Data.Validity.Validity kc, Data.Validity.Validity vc, Data.Validity.Validity k, Data.Validity.Validity v) => Data.Validity.Validity (Cursor.Map.KeyValue.KeyValueCursor kc vc k v) module Cursor.Simple.Map.KeyValue type KeyValueCursor k v = KeyValueCursor k v k v makeKeyValueCursorKey :: kc -> v -> KeyValueCursor kc vc k v makeKeyValueCursorValue :: k -> vc -> KeyValueCursor kc vc k v rebuildKeyValueCursor :: KeyValueCursor k v -> (k, v) keyValueCursorSelection :: KeyValueCursor kc vc k v -> KeyValueToggle mapKeyValueCursor :: (k -> l) -> (v -> w) -> KeyValueCursor k v -> KeyValueCursor l w keyValueCursorSelectKey :: KeyValueCursor k v -> KeyValueCursor k v keyValueCursorSelectValue :: KeyValueCursor k v -> KeyValueCursor k v keyValueCursorToggleSelected :: KeyValueCursor k v -> KeyValueCursor k v data KeyValueToggle KeySelected :: KeyValueToggle ValueSelected :: KeyValueToggle module Cursor.Text -- | A cursor for single-line texts newtype TextCursor TextCursor :: ListCursor Char -> TextCursor [textCursorList] :: TextCursor -> ListCursor Char emptyTextCursor :: TextCursor makeTextCursor :: Text -> Maybe TextCursor makeTextCursorWithSelection :: Int -> Text -> Maybe TextCursor rebuildTextCursor :: TextCursor -> Text textCursorNull :: TextCursor -> Bool textCursorLength :: TextCursor -> Int textCursorIndex :: TextCursor -> Int textCursorSelectPrev :: TextCursor -> Maybe TextCursor textCursorSelectNext :: TextCursor -> Maybe TextCursor textCursorSelectIndex :: Int -> TextCursor -> TextCursor textCursorSelectStart :: TextCursor -> TextCursor textCursorSelectEnd :: TextCursor -> TextCursor textCursorPrevChar :: TextCursor -> Maybe Char textCursorNextChar :: TextCursor -> Maybe Char textCursorInsert :: Char -> TextCursor -> Maybe TextCursor textCursorAppend :: Char -> TextCursor -> Maybe TextCursor textCursorRemove :: TextCursor -> Maybe TextCursor textCursorDelete :: TextCursor -> Maybe TextCursor textCursorSplit :: TextCursor -> (TextCursor, TextCursor) textCursorCombine :: TextCursor -> TextCursor -> TextCursor instance GHC.Generics.Generic Cursor.Text.TextCursor instance GHC.Classes.Eq Cursor.Text.TextCursor instance GHC.Show.Show Cursor.Text.TextCursor instance Data.Validity.Validity Cursor.Text.TextCursor module Cursor.Tree.Types data TreeCursor a b TreeCursor :: !(Maybe (TreeAbove b)) -> !a -> !(CForest b) -> TreeCursor a b [treeAbove] :: TreeCursor a b -> !(Maybe (TreeAbove b)) [treeCurrent] :: TreeCursor a b -> !a [treeBelow] :: TreeCursor a b -> !(CForest b) treeCursorAboveL :: Lens' (TreeCursor a b) (Maybe (TreeAbove b)) treeCursorCurrentL :: Lens' (TreeCursor a b) a treeCursorBelowL :: Lens' (TreeCursor a b) (CForest b) treeCursorCurrentSubTreeL :: Lens' (TreeCursor a b) (a, CForest b) data TreeAbove b TreeAbove :: ![CTree b] -> !(Maybe (TreeAbove b)) -> !b -> ![CTree b] -> TreeAbove b [treeAboveLefts] :: TreeAbove b -> ![CTree b] [treeAboveAbove] :: TreeAbove b -> !(Maybe (TreeAbove b)) [treeAboveNode] :: TreeAbove b -> !b [treeAboveRights] :: TreeAbove b -> ![CTree 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] data TreeCursorSelection SelectNode :: TreeCursorSelection SelectChild :: !Int -> !TreeCursorSelection -> TreeCursorSelection data CTree a CNode :: !a -> !(CForest a) -> CTree a makeCTree :: Tree a -> CTree a cTree :: Bool -> Tree a -> CTree a rebuildCTree :: CTree a -> Tree a data CForest a EmptyCForest :: CForest a ClosedForest :: !(NonEmpty (Tree a)) -> CForest a OpenForest :: !(NonEmpty (CTree a)) -> CForest a makeCForest :: Forest a -> CForest a cForest :: Bool -> Forest a -> CForest a rebuildCForest :: CForest a -> Forest a emptyCForest :: CForest a openForest :: [CTree a] -> CForest a closedForest :: [Tree a] -> CForest a lengthCForest :: CForest a -> Int unpackCForest :: CForest a -> [CTree a] instance GHC.Generics.Generic (Cursor.Tree.Types.TreeCursor a b) instance (GHC.Classes.Eq b, GHC.Classes.Eq a) => GHC.Classes.Eq (Cursor.Tree.Types.TreeCursor a b) instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (Cursor.Tree.Types.TreeCursor a b) instance GHC.Base.Functor Cursor.Tree.Types.TreeAbove instance GHC.Generics.Generic (Cursor.Tree.Types.TreeAbove b) instance GHC.Classes.Eq b => GHC.Classes.Eq (Cursor.Tree.Types.TreeAbove b) instance GHC.Show.Show b => GHC.Show.Show (Cursor.Tree.Types.TreeAbove b) instance GHC.Base.Functor Cursor.Tree.Types.CTree instance GHC.Generics.Generic (Cursor.Tree.Types.CTree a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Types.CTree a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Types.CTree a) instance GHC.Base.Functor Cursor.Tree.Types.CForest instance GHC.Generics.Generic (Cursor.Tree.Types.CForest a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Types.CForest a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Types.CForest a) instance GHC.Generics.Generic Cursor.Tree.Types.TreeCursorSelection instance GHC.Classes.Eq Cursor.Tree.Types.TreeCursorSelection instance GHC.Show.Show Cursor.Tree.Types.TreeCursorSelection instance (Data.Validity.Validity a, Data.Validity.Validity b) => Data.Validity.Validity (Cursor.Tree.Types.TreeCursor a b) instance Data.Validity.Validity b => Data.Validity.Validity (Cursor.Tree.Types.TreeAbove b) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Types.CTree a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Types.CForest a) instance Data.Validity.Validity Cursor.Tree.Types.TreeCursorSelection module Cursor.Tree.Swap -- | Swaps the current node with the previous node on the same level -- -- Example: -- -- Before: -- --
-- p -- |- a -- |- b <-- ---- -- After: -- --
-- p -- |- b <-- -- |- a --treeCursorSwapPrev :: TreeCursor a b -> SwapResult (TreeCursor a b) -- | Swaps the current node with the next node on the same level -- -- Example: -- -- Before: -- --
-- p -- |- a <-- -- |- b ---- -- After: -- --
-- p -- |- b -- |- a <-- --treeCursorSwapNext :: TreeCursor a b -> SwapResult (TreeCursor a b) data SwapResult a SwapperIsTopNode :: SwapResult a NoSiblingsToSwapWith :: SwapResult a Swapped :: a -> SwapResult a instance GHC.Base.Functor Cursor.Tree.Swap.SwapResult instance GHC.Generics.Generic (Cursor.Tree.Swap.SwapResult a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Swap.SwapResult a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Swap.SwapResult a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Swap.SwapResult a) module Cursor.Tree.Draw drawTreeCursor :: (Show a, Show b) => TreeCursor a b -> String treeCursorWithPointer :: (Show a, Show b) => TreeCursor a b -> Tree String showCForest :: Show a => CForest a -> Forest String showCTree :: Show a => CTree a -> Tree String showForest :: Show a => Forest a -> Forest String showTree :: Show a => Tree a -> Tree String module Cursor.Tree.Collapse treeCursorCloseCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) treeCursorOpenCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) treeCursorToggleCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) module Cursor.Tree.Base singletonTreeCursor :: a -> TreeCursor a b makeTreeCursor :: (b -> a) -> CTree b -> TreeCursor a b makeTreeCursorWithSelection :: (a -> b) -> (b -> a) -> TreeCursorSelection -> CTree b -> Maybe (TreeCursor a b) rebuildTreeCursor :: (a -> b) -> TreeCursor a b -> CTree b mapTreeCursor :: (a -> c) -> (b -> d) -> TreeCursor a b -> TreeCursor c d currentTree :: (a -> b) -> TreeCursor a b -> CTree b makeTreeCursorWithAbove :: (b -> a) -> CTree b -> Maybe (TreeAbove b) -> TreeCursor a b module Cursor.Tree.Promote -- | Promotes the current node to the level of its parent. -- -- Example: -- -- Before: -- --
-- p -- |- a -- | |- b -- | | |- c -- | |- d <-- -- | | |- e -- | |- f -- | |- g -- |- h ---- -- After: -- --
-- p -- |- a -- | |- b -- | | |- c -- | | |- e -- | |- f -- | |- g -- |- d <-- -- |- h --treeCursorPromoteElem :: (a -> b) -> (b -> a) -> TreeCursor a b -> PromoteElemResult (TreeCursor a b) data PromoteElemResult a CannotPromoteTopElem :: PromoteElemResult a NoGrandparentToPromoteElemUnder :: PromoteElemResult a NoSiblingsToAdoptChildren :: PromoteElemResult a PromotedElem :: a -> PromoteElemResult a -- | Promotes the current node to the level of its parent. -- -- Example: -- -- Before: -- --
-- p -- |- a -- | |- b -- | | |- c -- | |- d <-- -- | | |- e -- | |- f -- | |- g -- |- h ---- -- After: -- --
-- p -- |- a -- | |- b -- | | |- c -- | |- f -- | |- g -- |- d <-- -- | |- e -- |- h --treeCursorPromoteSubTree :: (a -> b) -> (b -> a) -> TreeCursor a b -> PromoteResult (TreeCursor a b) data PromoteResult a CannotPromoteTopNode :: PromoteResult a NoGrandparentToPromoteUnder :: PromoteResult a Promoted :: a -> PromoteResult a instance GHC.Base.Functor Cursor.Tree.Promote.PromoteResult instance GHC.Generics.Generic (Cursor.Tree.Promote.PromoteResult a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Promote.PromoteResult a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Promote.PromoteResult a) instance GHC.Base.Functor Cursor.Tree.Promote.PromoteElemResult instance GHC.Generics.Generic (Cursor.Tree.Promote.PromoteElemResult a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Promote.PromoteElemResult a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Promote.PromoteElemResult a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Promote.PromoteResult a) instance GHC.Base.Applicative Cursor.Tree.Promote.PromoteResult instance GHC.Base.Monad Cursor.Tree.Promote.PromoteResult instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Promote.PromoteElemResult a) instance GHC.Base.Applicative Cursor.Tree.Promote.PromoteElemResult instance GHC.Base.Monad Cursor.Tree.Promote.PromoteElemResult module Cursor.Tree.Movement treeCursorSelection :: TreeCursor a b -> TreeCursorSelection data TreeCursorSelection SelectNode :: TreeCursorSelection SelectChild :: !Int -> !TreeCursorSelection -> TreeCursorSelection treeCursorSelect :: (a -> b) -> (b -> a) -> TreeCursorSelection -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectPrev :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectNext :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectFirst :: (a -> b) -> (b -> a) -> TreeCursor a b -> TreeCursor a b treeCursorSelectLast :: (a -> b) -> (b -> a) -> TreeCursor a b -> TreeCursor a b treeCursorSelectAbove :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectBelowAtPos :: (a -> b) -> (b -> a) -> Int -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectBelowAtStart :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectBelowAtEnd :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectBelowAtStartRecursively :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectBelowAtEndRecursively :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectPrevOnSameLevel :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorSelectNextOnSameLevel :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) -- | Go back and down as far as necessary to find a previous element on a -- level below treeCursorSelectAbovePrev :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) -- | 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 treeCursorSelectAboveNext :: (a -> b) -> (b -> a) -> TreeCursor a b -> Maybe (TreeCursor a b) module Cursor.Tree.Insert treeCursorInsert :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorInsertAndSelect :: (a -> b) -> (b -> a) -> Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorAppend :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorAppendAndSelect :: (a -> b) -> (b -> a) -> Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) 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 module Cursor.Tree.Demote -- | Demotes the current node to the level of its children. -- -- Example: -- -- Before: -- --
-- p -- |- a -- | |- b -- |- c <-- -- | |- d -- |- e ---- -- After: -- --
-- p -- |- a -- | |- b -- | |- c <-- -- | |- d -- |- e --treeCursorDemoteElem :: (a -> b) -> (b -> a) -> TreeCursor a b -> DemoteResult (TreeCursor a b) -- | Demotes the current subtree to the level of its children. -- -- Example: -- -- Before: -- --
-- p -- |- a -- | |- b -- |- c <-- -- | |- d -- |- e ---- -- After: -- --
-- p -- |- a -- | |- b -- | |- c <-- -- | |- d -- |- e --treeCursorDemoteSubTree :: (a -> b) -> (b -> a) -> TreeCursor a b -> DemoteResult (TreeCursor a b) data DemoteResult a CannotDemoteTopNode :: DemoteResult a NoSiblingsToDemoteUnder :: DemoteResult a Demoted :: a -> DemoteResult a -- | 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 --treeCursorDemoteElemUnder :: b -> b -> TreeCursor a b -> Maybe (TreeCursor a b) -- | Demotes the current subtree to the level of its children, by adding a -- root. -- -- Example: -- -- Before: -- --
-- a <-- -- |- b ---- -- After: -- --
-- <given element> -- |- a <-- -- |- b --treeCursorDemoteSubTreeUnder :: b -> TreeCursor a b -> TreeCursor a b instance GHC.Base.Functor Cursor.Tree.Demote.DemoteResult instance GHC.Generics.Generic (Cursor.Tree.Demote.DemoteResult a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Tree.Demote.DemoteResult a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Tree.Demote.DemoteResult a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Tree.Demote.DemoteResult a) module Cursor.Types data DeleteOrUpdate a Deleted :: DeleteOrUpdate a Updated :: a -> DeleteOrUpdate a joinDeletes :: Maybe (DeleteOrUpdate a) -> Maybe (DeleteOrUpdate a) -> DeleteOrUpdate a joinDeletes3 :: Maybe (DeleteOrUpdate a) -> Maybe (DeleteOrUpdate a) -> Maybe (DeleteOrUpdate a) -> DeleteOrUpdate a joinPossibleDeletes :: Maybe (DeleteOrUpdate a) -> Maybe (DeleteOrUpdate a) -> Maybe (DeleteOrUpdate a) focusPossibleDeleteOrUpdate :: Lens' b a -> (a -> Maybe (DeleteOrUpdate a)) -> b -> Maybe (DeleteOrUpdate b) instance GHC.Generics.Generic (Cursor.Types.DeleteOrUpdate a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Cursor.Types.DeleteOrUpdate a) instance GHC.Show.Show a => GHC.Show.Show (Cursor.Types.DeleteOrUpdate a) instance Data.Validity.Validity a => Data.Validity.Validity (Cursor.Types.DeleteOrUpdate a) instance GHC.Base.Functor Cursor.Types.DeleteOrUpdate instance GHC.Base.Applicative Cursor.Types.DeleteOrUpdate instance GHC.Base.Alternative Cursor.Types.DeleteOrUpdate module Cursor.Tree.Delete treeCursorDeleteSubTreeAndSelectPrevious :: (b -> a) -> TreeCursor a b -> Maybe (DeleteOrUpdate (TreeCursor a b)) treeCursorDeleteSubTreeAndSelectNext :: (b -> a) -> TreeCursor a b -> Maybe (DeleteOrUpdate (TreeCursor a b)) treeCursorDeleteSubTreeAndSelectAbove :: (b -> a) -> TreeCursor a b -> DeleteOrUpdate (TreeCursor a b) treeCursorRemoveSubTree :: (b -> a) -> TreeCursor a b -> DeleteOrUpdate (TreeCursor a b) treeCursorDeleteSubTree :: (b -> a) -> TreeCursor a b -> DeleteOrUpdate (TreeCursor a b) treeCursorDeleteElemAndSelectPrevious :: (b -> a) -> TreeCursor a b -> Maybe (DeleteOrUpdate (TreeCursor a b)) treeCursorDeleteElemAndSelectNext :: (b -> a) -> TreeCursor a b -> Maybe (DeleteOrUpdate (TreeCursor a b)) treeCursorDeleteElemAndSelectAbove :: (b -> a) -> TreeCursor a b -> Maybe (DeleteOrUpdate (TreeCursor a b)) treeCursorRemoveElem :: (b -> a) -> TreeCursor a b -> DeleteOrUpdate (TreeCursor a b) treeCursorDeleteElem :: (b -> a) -> TreeCursor a b -> DeleteOrUpdate (TreeCursor a b) module Cursor.Tree data TreeCursor a b TreeCursor :: !(Maybe (TreeAbove b)) -> !a -> !(CForest b) -> TreeCursor a b [treeAbove] :: TreeCursor a b -> !(Maybe (TreeAbove b)) [treeCurrent] :: TreeCursor a b -> !a [treeBelow] :: TreeCursor a b -> !(CForest b) data TreeAbove b TreeAbove :: ![CTree b] -> !(Maybe (TreeAbove b)) -> !b -> ![CTree b] -> TreeAbove b [treeAboveLefts] :: TreeAbove b -> ![CTree b] [treeAboveAbove] :: TreeAbove b -> !(Maybe (TreeAbove b)) [treeAboveNode] :: TreeAbove b -> !b [treeAboveRights] :: TreeAbove b -> ![CTree b] module Cursor.Simple.Tree type TreeCursor a = TreeCursor a a data TreeAbove b TreeAbove :: ![CTree b] -> !(Maybe (TreeAbove b)) -> !b -> ![CTree b] -> TreeAbove b [treeAboveLefts] :: TreeAbove b -> ![CTree b] [treeAboveAbove] :: TreeAbove b -> !(Maybe (TreeAbove b)) [treeAboveNode] :: TreeAbove b -> !b [treeAboveRights] :: TreeAbove b -> ![CTree b] singletonTreeCursor :: a -> TreeCursor a makeTreeCursor :: CTree a -> TreeCursor a 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) 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 SelectNode :: TreeCursorSelection SelectChild :: !Int -> !TreeCursorSelection -> 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) -- | Go back and down as far as necessary to find a previous element on a -- level below treeCursorSelectAbovePrev :: TreeCursor a -> Maybe (TreeCursor a) -- | 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 treeCursorSelectAboveNext :: TreeCursor a -> Maybe (TreeCursor a) treeCursorCloseCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) treeCursorOpenCurrentForest :: TreeCursor a b -> Maybe (TreeCursor a b) treeCursorToggleCurrentForest :: 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) treeCursorAppend :: Tree b -> TreeCursor a b -> Maybe (TreeCursor a b) treeCursorAppendAndSelect :: Tree 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 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) -- | Swaps the current node with the previous node on the same level -- -- Example: -- -- Before: -- --
-- p -- |- a -- |- b <-- ---- -- After: -- --
-- p -- |- b <-- -- |- a --treeCursorSwapPrev :: TreeCursor a b -> SwapResult (TreeCursor a b) -- | Swaps the current node with the next node on the same level -- -- Example: -- -- Before: -- --
-- p -- |- a <-- -- |- b ---- -- After: -- --
-- p -- |- b -- |- a <-- --treeCursorSwapNext :: TreeCursor a b -> SwapResult (TreeCursor a b) data SwapResult a SwapperIsTopNode :: SwapResult a NoSiblingsToSwapWith :: SwapResult a Swapped :: a -> SwapResult a treeCursorPromoteElem :: TreeCursor a -> PromoteElemResult (TreeCursor a) data PromoteElemResult a CannotPromoteTopElem :: PromoteElemResult a NoGrandparentToPromoteElemUnder :: PromoteElemResult a NoSiblingsToAdoptChildren :: PromoteElemResult a PromotedElem :: a -> PromoteElemResult a treeCursorPromoteSubTree :: TreeCursor a -> PromoteResult (TreeCursor a) data PromoteResult a CannotPromoteTopNode :: PromoteResult a NoGrandparentToPromoteUnder :: PromoteResult a Promoted :: a -> PromoteResult a treeCursorDemoteElem :: TreeCursor a -> DemoteResult (TreeCursor a) treeCursorDemoteSubTree :: TreeCursor a -> DemoteResult (TreeCursor a) data DemoteResult a CannotDemoteTopNode :: DemoteResult a NoSiblingsToDemoteUnder :: DemoteResult a Demoted :: a -> DemoteResult a -- | 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 --treeCursorDemoteElemUnder :: b -> b -> TreeCursor a b -> Maybe (TreeCursor a b) -- | Demotes the current subtree to the level of its children, by adding a -- root. -- -- Example: -- -- Before: -- --
-- a <-- -- |- b ---- -- After: -- --
-- <given element> -- |- a <-- -- |- b --treeCursorDemoteSubTreeUnder :: b -> TreeCursor a b -> TreeCursor a b data CTree a CNode :: !a -> !(CForest a) -> CTree a data CForest a makeCTree :: Tree a -> CTree a cTree :: Bool -> Tree a -> CTree a rebuildCTree :: CTree a -> Tree a module Cursor.List.NonEmpty -- | A 'nonempty list' cursor data NonEmptyCursor a b NonEmptyCursor :: [b] -> a -> [b] -> NonEmptyCursor a b [nonEmptyCursorPrev] :: NonEmptyCursor a b -> [b] [nonEmptyCursorCurrent] :: NonEmptyCursor a b -> a [nonEmptyCursorNext] :: NonEmptyCursor a b -> [b] makeNonEmptyCursor :: (b -> a) -> NonEmpty b -> NonEmptyCursor a b makeNonEmptyCursorWithSelection :: (b -> a) -> Int -> NonEmpty b -> Maybe (NonEmptyCursor a b) singletonNonEmptyCursor :: a -> NonEmptyCursor a b rebuildNonEmptyCursor :: (a -> b) -> NonEmptyCursor a b -> NonEmpty b nonEmptyCursorElemL :: Lens (NonEmptyCursor a c) (NonEmptyCursor b c) a b mapNonEmptyCursor :: (a -> c) -> (b -> d) -> NonEmptyCursor a b -> NonEmptyCursor c d nonEmptyCursorSelectPrev :: (a -> b) -> (b -> a) -> NonEmptyCursor a b -> Maybe (NonEmptyCursor a b) nonEmptyCursorSelectNext :: (a -> b) -> (b -> a) -> NonEmptyCursor a b -> Maybe (NonEmptyCursor a b) nonEmptyCursorSelectFirst :: (a -> b) -> (b -> a) -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorSelectLast :: (a -> b) -> (b -> a) -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorSelection :: NonEmptyCursor a b -> Int nonEmptyCursorSelectIndex :: (a -> b) -> (b -> a) -> Int -> NonEmptyCursor a b -> Maybe (NonEmptyCursor a b) nonEmptyCursorInsert :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppend :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorInsertAndSelect :: (a -> b) -> a -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppendAndSelect :: (a -> b) -> a -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorInsertAtStart :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppendAtEnd :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorInsertAtStartAndSelect :: (a -> b) -> (b -> a) -> b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppendAtEndAndSelect :: (a -> b) -> (b -> a) -> b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorRemoveElemAndSelectPrev :: (b -> a) -> NonEmptyCursor a b -> Maybe (DeleteOrUpdate (NonEmptyCursor a b)) nonEmptyCursorDeleteElemAndSelectNext :: (b -> a) -> NonEmptyCursor a b -> Maybe (DeleteOrUpdate (NonEmptyCursor a b)) nonEmptyCursorRemoveElem :: (b -> a) -> NonEmptyCursor a b -> DeleteOrUpdate (NonEmptyCursor a b) nonEmptyCursorDeleteElem :: (b -> a) -> NonEmptyCursor a b -> DeleteOrUpdate (NonEmptyCursor a b) nonEmptyCursorSearch :: (a -> b) -> (b -> a) -> (a -> Bool) -> NonEmptyCursor a b -> Maybe (NonEmptyCursor a b) nonEmptyCursorSelectOrAdd :: (a -> b) -> (b -> a) -> (a -> Bool) -> a -> NonEmptyCursor a b -> NonEmptyCursor a b nonemptyPrepend :: [a] -> NonEmpty a -> NonEmpty a nonemptyAppend :: NonEmpty a -> [a] -> NonEmpty a instance GHC.Base.Functor (Cursor.List.NonEmpty.NonEmptyCursor a) instance GHC.Generics.Generic (Cursor.List.NonEmpty.NonEmptyCursor a b) instance (GHC.Classes.Eq b, GHC.Classes.Eq a) => GHC.Classes.Eq (Cursor.List.NonEmpty.NonEmptyCursor a b) instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (Cursor.List.NonEmpty.NonEmptyCursor a b) instance (Data.Validity.Validity a, Data.Validity.Validity b) => Data.Validity.Validity (Cursor.List.NonEmpty.NonEmptyCursor a b) module Cursor.TextField newtype TextFieldCursor TextFieldCursor :: NonEmptyCursor TextCursor Text -> TextFieldCursor [textFieldCursorNonEmpty] :: TextFieldCursor -> NonEmptyCursor TextCursor Text makeTextFieldCursor :: Text -> TextFieldCursor makeTextFieldCursorWithSelection :: Int -> Int -> Text -> Maybe TextFieldCursor rebuildTextFieldCursorLines :: TextFieldCursor -> NonEmpty Text rebuildTextFieldCursor :: TextFieldCursor -> Text emptyTextFieldCursor :: TextFieldCursor nullTextFieldCursor :: TextFieldCursor -> Bool textFieldCursorSelection :: TextFieldCursor -> (Int, Int) textFieldCursorNonEmptyCursorL :: Lens' TextFieldCursor (NonEmptyCursor TextCursor Text) textFieldCursorSelectedL :: Lens' TextFieldCursor TextCursor textFieldCursorSelectPrevLine :: TextFieldCursor -> Maybe TextFieldCursor textFieldCursorSelectNextLine :: TextFieldCursor -> Maybe TextFieldCursor textFieldCursorSelectFirstLine :: TextFieldCursor -> TextFieldCursor textFieldCursorSelectLastLine :: TextFieldCursor -> TextFieldCursor textFieldCursorSelectPrevChar :: TextFieldCursor -> Maybe TextFieldCursor textFieldCursorSelectNextChar :: TextFieldCursor -> Maybe TextFieldCursor textFieldCursorIndexOnLine :: TextFieldCursor -> Int textFieldCursorSelectIndexOnLine :: Int -> TextFieldCursor -> TextFieldCursor textFieldCursorInsertChar :: Char -> Maybe TextFieldCursor -> TextFieldCursor textFieldCursorAppendChar :: Char -> Maybe TextFieldCursor -> TextFieldCursor textFieldCursorInsertNewline :: Maybe TextFieldCursor -> TextFieldCursor textFieldCursorAppendNewline :: Maybe TextFieldCursor -> TextFieldCursor textFieldCursorRemove :: TextFieldCursor -> Maybe (DeleteOrUpdate TextFieldCursor) textFieldCursorDelete :: TextFieldCursor -> Maybe (DeleteOrUpdate TextFieldCursor) textFieldCursorSelectStartOfLine :: TextFieldCursor -> TextFieldCursor textFieldCursorSelectEndOfLine :: TextFieldCursor -> TextFieldCursor instance GHC.Generics.Generic Cursor.TextField.TextFieldCursor instance GHC.Classes.Eq Cursor.TextField.TextFieldCursor instance GHC.Show.Show Cursor.TextField.TextFieldCursor instance Data.Validity.Validity Cursor.TextField.TextFieldCursor module Cursor.Simple.List.NonEmpty -- | A 'nonempty list' cursor type NonEmptyCursor a = NonEmptyCursor a a nonEmptyCursorPrev :: NonEmptyCursor a b -> [b] nonEmptyCursorCurrent :: NonEmptyCursor a b -> a nonEmptyCursorNext :: NonEmptyCursor a b -> [b] makeNonEmptyCursor :: NonEmpty a -> NonEmptyCursor a makeNonEmptyCursorWithSelection :: Int -> NonEmpty a -> Maybe (NonEmptyCursor a) singletonNonEmptyCursor :: a -> NonEmptyCursor a b rebuildNonEmptyCursor :: NonEmptyCursor a -> NonEmpty a mapNonEmptyCursor :: (a -> b) -> NonEmptyCursor a -> NonEmptyCursor b nonEmptyCursorElemL :: Lens (NonEmptyCursor a c) (NonEmptyCursor b c) a b nonEmptyCursorSelectPrev :: NonEmptyCursor a -> Maybe (NonEmptyCursor a) nonEmptyCursorSelectNext :: NonEmptyCursor a -> Maybe (NonEmptyCursor a) nonEmptyCursorSelectFirst :: NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorSelectLast :: NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorSelection :: NonEmptyCursor a b -> Int nonEmptyCursorSelectIndex :: Int -> NonEmptyCursor a -> Maybe (NonEmptyCursor a) nonEmptyCursorInsert :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppend :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorInsertAndSelect :: a -> NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorAppendAndSelect :: a -> NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorInsertAtStart :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorAppendAtEnd :: b -> NonEmptyCursor a b -> NonEmptyCursor a b nonEmptyCursorInsertAtStartAndSelect :: a -> NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorAppendAtEndAndSelect :: a -> NonEmptyCursor a -> NonEmptyCursor a nonEmptyCursorRemoveElemAndSelectPrev :: NonEmptyCursor a -> Maybe (DeleteOrUpdate (NonEmptyCursor a)) nonEmptyCursorDeleteElemAndSelectNext :: NonEmptyCursor a -> Maybe (DeleteOrUpdate (NonEmptyCursor a)) nonEmptyCursorRemoveElem :: NonEmptyCursor a -> DeleteOrUpdate (NonEmptyCursor a) nonEmptyCursorDeleteElem :: NonEmptyCursor a -> DeleteOrUpdate (NonEmptyCursor a) nonEmptyCursorSearch :: (a -> Bool) -> NonEmptyCursor a -> Maybe (NonEmptyCursor a) nonEmptyCursorSelectOrAdd :: (a -> Bool) -> a -> NonEmptyCursor a -> NonEmptyCursor a module Cursor.Map newtype MapCursor kc vc k v MapCursor :: NonEmptyCursor (KeyValueCursor kc vc k v) (k, v) -> MapCursor kc vc k v [mapCursorList] :: MapCursor kc vc k v -> NonEmptyCursor (KeyValueCursor kc vc k v) (k, v) makeMapCursor :: (k -> kc) -> NonEmpty (k, v) -> MapCursor kc vc k v makeMapCursorWithSelection :: (k -> kc) -> Int -> NonEmpty (k, v) -> Maybe (MapCursor kc vc k v) singletonMapCursorKey :: kc -> v -> MapCursor kc vc k v singletonMapCursorValue :: k -> vc -> MapCursor kc vc k v rebuildMapCursor :: (kc -> k) -> (vc -> v) -> MapCursor kc vc k v -> NonEmpty (k, v) mapMapCursor :: (kc -> lc) -> (vc -> wc) -> (k -> l) -> (v -> w) -> MapCursor kc vc k v -> MapCursor lc wc l w mapCursorNonEmptyCursorL :: Lens (MapCursor kc vc k v) (MapCursor lc wc l w) (NonEmptyCursor (KeyValueCursor kc vc k v) (k, v)) (NonEmptyCursor (KeyValueCursor lc wc l w) (l, w)) mapCursorElemL :: Lens' (MapCursor kc vc k v) (KeyValueCursor kc vc k v) mapCursorSelectKey :: (k -> kc) -> (vc -> v) -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorSelectValue :: (kc -> k) -> (v -> vc) -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorToggleSelected :: (kc -> k) -> (k -> kc) -> (vc -> v) -> (v -> vc) -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorSelectPrev :: (kc -> k) -> (k -> kc) -> (vc -> v) -> MapCursor kc vc k v -> Maybe (MapCursor kc vc k v) mapCursorSelectNext :: (kc -> k) -> (k -> kc) -> (vc -> v) -> MapCursor kc vc k v -> Maybe (MapCursor kc vc k v) mapCursorSelectFirst :: (kc -> k) -> (k -> kc) -> (vc -> v) -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorSelectLast :: (kc -> k) -> (k -> kc) -> (vc -> v) -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorSelection :: MapCursor kc vc k v -> Int mapCursorSelectIndex :: (kc -> k) -> (k -> kc) -> (vc -> v) -> Int -> MapCursor kc vc k v -> Maybe (MapCursor kc vc k v) mapCursorInsert :: k -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorAppend :: k -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorInsertAndSelectKey :: (kc -> k) -> (vc -> v) -> kc -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorAppendAndSelectKey :: (kc -> k) -> (vc -> v) -> kc -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorInsertAndSelectValue :: (kc -> k) -> (vc -> v) -> k -> vc -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorAppendAndSelectValue :: (kc -> k) -> (vc -> v) -> k -> vc -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorRemoveElemAndSelectPrev :: (k -> kc) -> MapCursor kc vc k v -> Maybe (DeleteOrUpdate (MapCursor kc vc k v)) mapCursorDeleteElemAndSelectNext :: (k -> kc) -> MapCursor kc vc k v -> Maybe (DeleteOrUpdate (MapCursor kc vc k v)) mapCursorRemoveElem :: (k -> kc) -> MapCursor kc vc k v -> DeleteOrUpdate (MapCursor kc vc k v) mapCursorDeleteElem :: (k -> kc) -> MapCursor kc vc k v -> DeleteOrUpdate (MapCursor kc vc k v) mapCursorSearch :: (kc -> k) -> (k -> kc) -> (vc -> v) -> (k -> v -> Bool) -> MapCursor kc vc k v -> Maybe (MapCursor kc vc k v) mapCursorSelectOrAdd :: (kc -> k) -> (k -> kc) -> (vc -> v) -> (k -> v -> Bool) -> KeyValueCursor kc vc k v -> MapCursor kc vc k v -> MapCursor kc vc k v instance GHC.Generics.Generic (Cursor.Map.MapCursor kc vc k v) instance (GHC.Classes.Eq k, GHC.Classes.Eq v, GHC.Classes.Eq kc, GHC.Classes.Eq vc) => GHC.Classes.Eq (Cursor.Map.MapCursor kc vc k v) instance (GHC.Show.Show k, GHC.Show.Show v, GHC.Show.Show kc, GHC.Show.Show vc) => GHC.Show.Show (Cursor.Map.MapCursor kc vc k v) instance (Data.Validity.Validity kc, Data.Validity.Validity vc, Data.Validity.Validity k, Data.Validity.Validity v) => Data.Validity.Validity (Cursor.Map.MapCursor kc vc k v) module Cursor.Simple.Map type MapCursor k v = MapCursor k v k v mapCursorList :: MapCursor kc vc k v -> NonEmptyCursor (KeyValueCursor kc vc k v) (k, v) makeMapCursor :: NonEmpty (k, v) -> MapCursor k v makeMapCursorWithSelection :: Int -> NonEmpty (k, v) -> Maybe (MapCursor k v) singletonMapCursorKey :: kc -> v -> MapCursor kc vc k v singletonMapCursorValue :: k -> vc -> MapCursor kc vc k v rebuildMapCursor :: MapCursor k v -> NonEmpty (k, v) mapMapCursor :: (k -> l) -> (v -> w) -> MapCursor k v -> MapCursor l w mapCursorNonEmptyCursorL :: Lens (MapCursor kc vc k v) (MapCursor lc wc l w) (NonEmptyCursor (KeyValueCursor kc vc k v) (k, v)) (NonEmptyCursor (KeyValueCursor lc wc l w) (l, w)) mapCursorElemL :: Lens' (MapCursor kc vc k v) (KeyValueCursor kc vc k v) mapCursorSelectKey :: MapCursor k v -> MapCursor k v mapCursorSelectValue :: MapCursor k v -> MapCursor k v mapCursorToggleSelected :: MapCursor k v -> MapCursor k v mapCursorSelectPrev :: MapCursor k v -> Maybe (MapCursor k v) mapCursorSelectNext :: MapCursor k v -> Maybe (MapCursor k v) mapCursorSelectFirst :: MapCursor k v -> MapCursor k v mapCursorSelectLast :: MapCursor k v -> MapCursor k v mapCursorSelection :: MapCursor kc vc k v -> Int mapCursorSelectIndex :: Int -> MapCursor k v -> Maybe (MapCursor k v) mapCursorInsert :: k -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorAppend :: k -> v -> MapCursor kc vc k v -> MapCursor kc vc k v mapCursorInsertAndSelectKey :: k -> v -> MapCursor k v -> MapCursor k v mapCursorAppendAndSelectKey :: k -> v -> MapCursor k v -> MapCursor k v mapCursorInsertAndSelectValue :: k -> v -> MapCursor k v -> MapCursor k v mapCursorAppendAndSelectValue :: k -> v -> MapCursor k v -> MapCursor k v mapCursorRemoveElemAndSelectPrev :: MapCursor k v -> Maybe (DeleteOrUpdate (MapCursor k v)) mapCursorDeleteElemAndSelectNext :: MapCursor k v -> Maybe (DeleteOrUpdate (MapCursor k v)) mapCursorRemoveElem :: MapCursor k v -> DeleteOrUpdate (MapCursor k v) mapCursorDeleteElem :: MapCursor k v -> DeleteOrUpdate (MapCursor k v) mapCursorSearch :: (k -> v -> Bool) -> MapCursor k v -> Maybe (MapCursor k v) mapCursorSelectOrAdd :: (k -> v -> Bool) -> KeyValueCursor k v -> MapCursor k v -> MapCursor k v module Cursor.Forest newtype ForestCursor a b ForestCursor :: NonEmptyCursor (TreeCursor a b) (CTree b) -> ForestCursor a b [forestCursorListCursor] :: ForestCursor a b -> NonEmptyCursor (TreeCursor a b) (CTree b) makeForestCursor :: (b -> a) -> NonEmpty (CTree b) -> ForestCursor a b rebuildForestCursor :: (a -> b) -> ForestCursor a b -> NonEmpty (CTree b) drawForestCursor :: (Show a, Show b) => ForestCursor a b -> String mapForestCursor :: (a -> c) -> (b -> d) -> ForestCursor a b -> ForestCursor c d forestCursorListCursorL :: Lens (ForestCursor a b) (ForestCursor c d) (NonEmptyCursor (TreeCursor a b) (CTree b)) (NonEmptyCursor (TreeCursor c d) (CTree d)) forestCursorSelectedTreeL :: Lens' (ForestCursor a b) (TreeCursor a b) forestCursorSelectPrevTreeCursor :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectNextTreeCursor :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectFirstTreeCursor :: (a -> b) -> (b -> a) -> ForestCursor a b -> ForestCursor a b forestCursorSelectLastTreeCursor :: (a -> b) -> (b -> a) -> ForestCursor a b -> ForestCursor a b forestCursorSelectPrev :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectNext :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectPrevOnSameLevel :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectNextOnSameLevel :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectFirst :: (a -> b) -> (b -> a) -> ForestCursor a b -> ForestCursor a b forestCursorSelectLast :: (a -> b) -> (b -> a) -> ForestCursor a b -> ForestCursor a b forestCursorSelectBelowAtPos :: (a -> b) -> (b -> a) -> Int -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectBelowAtStart :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelectBelowAtEnd :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelection :: ForestCursor a b -> Int forestCursorSelectIndex :: (a -> b) -> (b -> a) -> Int -> ForestCursor a b -> Maybe (ForestCursor a b) forestCursorCloseCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorOpenCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorToggleCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorInsertEntireTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAppendEntireTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelectTreeCursor :: (a -> b) -> TreeCursor a b -> ForestCursor a b -> ForestCursor a b forestCursorAppendAndSelectTreeCursor :: (a -> b) -> TreeCursor a b -> ForestCursor a b -> ForestCursor a b forestCursorInsertTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAppendTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelectTree :: (a -> b) -> (b -> a) -> Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAppendAndSelectTree :: (a -> b) -> (b -> a) -> Tree b -> ForestCursor a b -> ForestCursor a b forestCursorInsert :: b -> ForestCursor a b -> ForestCursor a b forestCursorAppend :: b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelect :: (a -> b) -> (b -> a) -> b -> ForestCursor a b -> ForestCursor a b forestCursorAppendAndSelect :: (a -> b) -> (b -> a) -> b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildTreeToNodeAtPos :: Int -> Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildTreeToNodeAtStart :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildTreeToNodeAtEnd :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtPos :: Int -> b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtStart :: b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtEnd :: b -> ForestCursor a b -> ForestCursor a b forestCursorRemoveElemAndSelectPrev :: (b -> a) -> ForestCursor a b -> Maybe (DeleteOrUpdate (ForestCursor a b)) forestCursorDeleteElemAndSelectNext :: (b -> a) -> ForestCursor a b -> Maybe (DeleteOrUpdate (ForestCursor a b)) forestCursorRemoveElem :: (b -> a) -> ForestCursor a b -> DeleteOrUpdate (ForestCursor a b) forestCursorDeleteElem :: (b -> a) -> ForestCursor a b -> DeleteOrUpdate (ForestCursor a b) forestCursorRemoveSubTreeAndSelectPrev :: (b -> a) -> ForestCursor a b -> Maybe (DeleteOrUpdate (ForestCursor a b)) forestCursorDeleteSubTreeAndSelectNext :: (b -> a) -> ForestCursor a b -> Maybe (DeleteOrUpdate (ForestCursor a b)) forestCursorRemoveSubTree :: (b -> a) -> ForestCursor a b -> DeleteOrUpdate (ForestCursor a b) forestCursorDeleteSubTree :: (b -> a) -> ForestCursor a b -> DeleteOrUpdate (ForestCursor a b) forestCursorAddRoot :: (a -> b) -> (b -> a) -> ForestCursor a b -> a -> TreeCursor a b -- | Swaps the current node with the previous node on the same level -- -- Example: -- -- Before: -- --
-- - a -- - b <-- ---- -- After: -- --
-- - b <-- -- - a --forestCursorSwapPrev :: ForestCursor a b -> Maybe (ForestCursor a b) -- | Swaps the current node with the next node on the same level -- -- Example: -- -- Before: -- --
-- - a <-- -- - b ---- -- After: -- --
-- - b -- - a <-- --forestCursorSwapNext :: ForestCursor a b -> Maybe (ForestCursor a b) -- | Promotes the current node to the level of its parent. -- -- Example: -- -- Before: -- --
-- - a -- |- b -- | |- c -- |- d <-- -- | |- e -- |- f -- |- g -- - h ---- -- After: -- --
-- - a -- |- b -- | |- c -- | |- e -- |- f -- |- g -- - d <-- -- - h --forestCursorPromoteElem :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) -- | Promotes the current node to the level of its parent. -- -- Example: -- -- Before: -- --
-- - a -- |- b -- | |- c -- |- d <-- -- | |- e -- |- f -- |- g -- - h ---- -- After: -- --
-- - a -- |- b -- | |- c -- |- f -- |- g -- - d <-- -- |- e -- - h --forestCursorPromoteSubTree :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) -- | Demotes the current node to the level of its children. -- -- Example: -- -- Before: -- --
-- - a -- |- b -- - c <-- -- |- d -- - e ---- -- After: -- --
-- - a -- |- b -- |- c <-- -- |- d -- - e --forestCursorDemoteElem :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) -- | Demotes the current subtree to the level of its children. -- -- Example: -- -- Before: -- --
-- - a -- |- b -- - c <-- -- |- d ---- -- After: -- --
-- - a -- |- b -- |- c <-- -- |- d --forestCursorDemoteSubTree :: (a -> b) -> (b -> a) -> ForestCursor a b -> Maybe (ForestCursor a b) -- | 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: -- --
-- - a <-- -- |- b ---- -- After: -- --
-- - <given element 1> -- |- a <-- -- - <given element 2> -- |- b --forestCursorDemoteElemUnder :: b -> b -> ForestCursor a b -> ForestCursor a b -- | Demotes the current subtree to the level of its children, by adding a -- root. -- -- Example: -- -- Before: -- --
-- a <-- -- |- b ---- -- After: -- --
-- <given element> -- |- a <-- -- |- b --forestCursorDemoteSubTreeUnder :: b -> ForestCursor a b -> ForestCursor a b data CTree a CNode :: !a -> !(CForest a) -> CTree a makeCTree :: Tree a -> CTree a cTree :: Bool -> Tree a -> CTree a rebuildCTree :: CTree a -> Tree a data CForest a EmptyCForest :: CForest a ClosedForest :: !(NonEmpty (Tree a)) -> CForest a OpenForest :: !(NonEmpty (CTree a)) -> CForest a makeCForest :: Forest a -> CForest a cForest :: Bool -> Forest a -> CForest a rebuildCForest :: CForest a -> Forest a instance GHC.Generics.Generic (Cursor.Forest.ForestCursor a b) instance (GHC.Classes.Eq b, GHC.Classes.Eq a) => GHC.Classes.Eq (Cursor.Forest.ForestCursor a b) instance (GHC.Show.Show b, GHC.Show.Show a) => GHC.Show.Show (Cursor.Forest.ForestCursor a b) instance (Data.Validity.Validity a, Data.Validity.Validity b) => Data.Validity.Validity (Cursor.Forest.ForestCursor a b) module Cursor.Simple.Forest type ForestCursor a = ForestCursor a a makeForestCursor :: NonEmpty (CTree a) -> ForestCursor a rebuildForestCursor :: ForestCursor a -> NonEmpty (CTree a) drawForestCursor :: (Show a, Show b) => ForestCursor a b -> String mapForestCursor :: (a -> b) -> ForestCursor a -> ForestCursor b forestCursorListCursorL :: Lens (ForestCursor a b) (ForestCursor c d) (NonEmptyCursor (TreeCursor a b) (CTree b)) (NonEmptyCursor (TreeCursor c d) (CTree d)) forestCursorSelectedTreeL :: Lens' (ForestCursor a b) (TreeCursor a b) forestCursorSelectPrevTreeCursor :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectNextTreeCursor :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectFirstTreeCursor :: ForestCursor a -> ForestCursor a forestCursorSelectLastTreeCursor :: ForestCursor a -> ForestCursor a forestCursorSelectPrev :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectNext :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectPrevOnSameLevel :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectNextOnSameLevel :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectFirst :: ForestCursor a -> ForestCursor a forestCursorSelectLast :: ForestCursor a -> ForestCursor a forestCursorSelectBelowAtPos :: Int -> ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectBelowAtStart :: ForestCursor a -> Maybe (ForestCursor a) forestCursorSelectBelowAtEnd :: ForestCursor a -> Maybe (ForestCursor a) forestCursorCloseCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorOpenCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorToggleCurrentForest :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorSelection :: ForestCursor a b -> Int forestCursorSelectIndex :: Int -> ForestCursor a -> Maybe (ForestCursor a) forestCursorInsertEntireTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelectTreeCursor :: TreeCursor a -> ForestCursor a -> ForestCursor a forestCursorAppendEntireTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAppendAndSelectTreeCursor :: TreeCursor a -> ForestCursor a -> ForestCursor a forestCursorInsertTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAppendTree :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelectTree :: Tree a -> ForestCursor a -> ForestCursor a forestCursorAppendAndSelectTree :: Tree a -> ForestCursor a -> ForestCursor a forestCursorInsert :: b -> ForestCursor a b -> ForestCursor a b forestCursorAppend :: b -> ForestCursor a b -> ForestCursor a b forestCursorInsertAndSelect :: a -> ForestCursor a -> ForestCursor a forestCursorAppendAndSelect :: a -> ForestCursor a -> ForestCursor a forestCursorAddChildTreeToNodeAtPos :: Int -> Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildTreeToNodeAtStart :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildTreeToNodeAtEnd :: Tree b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtPos :: Int -> b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtStart :: b -> ForestCursor a b -> ForestCursor a b forestCursorAddChildToNodeAtEnd :: b -> ForestCursor a b -> ForestCursor a b forestCursorRemoveElemAndSelectPrev :: ForestCursor a -> Maybe (DeleteOrUpdate (ForestCursor a)) forestCursorDeleteElemAndSelectNext :: ForestCursor a -> Maybe (DeleteOrUpdate (ForestCursor a)) forestCursorRemoveElem :: ForestCursor a -> DeleteOrUpdate (ForestCursor a) forestCursorDeleteElem :: ForestCursor a -> DeleteOrUpdate (ForestCursor a) forestCursorRemoveSubTreeAndSelectPrev :: ForestCursor a -> Maybe (DeleteOrUpdate (ForestCursor a)) forestCursorDeleteSubTreeAndSelectNext :: ForestCursor a -> Maybe (DeleteOrUpdate (ForestCursor a)) forestCursorRemoveSubTree :: ForestCursor a -> DeleteOrUpdate (ForestCursor a) forestCursorDeleteSubTree :: ForestCursor a -> DeleteOrUpdate (ForestCursor a) forestCursorAddRoot :: ForestCursor a -> a -> TreeCursor a -- | Swaps the current node with the previous node on the same level -- -- Example: -- -- Before: -- --
-- - a -- - b <-- ---- -- After: -- --
-- - b <-- -- - a --forestCursorSwapPrev :: ForestCursor a b -> Maybe (ForestCursor a b) -- | Swaps the current node with the next node on the same level -- -- Example: -- -- Before: -- --
-- - a <-- -- - b ---- -- After: -- --
-- - b -- - a <-- --forestCursorSwapNext :: ForestCursor a b -> Maybe (ForestCursor a b) forestCursorPromoteElem :: ForestCursor a -> Maybe (ForestCursor a) forestCursorPromoteSubTree :: ForestCursor a -> Maybe (ForestCursor a) forestCursorDemoteElem :: ForestCursor a -> Maybe (ForestCursor a) forestCursorDemoteSubTree :: ForestCursor a -> Maybe (ForestCursor a) -- | 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: -- --
-- - a <-- -- |- b ---- -- After: -- --
-- - <given element 1> -- |- a <-- -- - <given element 2> -- |- b --forestCursorDemoteElemUnder :: b -> b -> ForestCursor a b -> ForestCursor a b -- | Demotes the current subtree to the level of its children, by adding a -- root. -- -- Example: -- -- Before: -- --
-- a <-- -- |- b ---- -- After: -- --
-- <given element> -- |- a <-- -- |- b --forestCursorDemoteSubTreeUnder :: b -> ForestCursor a b -> ForestCursor a b data CTree a CNode :: !a -> !(CForest a) -> CTree a makeCTree :: Tree a -> CTree a cTree :: Bool -> Tree a -> CTree a rebuildCTree :: CTree a -> Tree a data CForest a EmptyCForest :: CForest a ClosedForest :: !(NonEmpty (Tree a)) -> CForest a OpenForest :: !(NonEmpty (CTree a)) -> CForest a makeCForest :: Forest a -> CForest a cForest :: Bool -> Forest a -> CForest a rebuildCForest :: CForest a -> Forest a