cursor-0.3.0.0: Purely Functional Cursors

Safe HaskellNone
LanguageHaskell2010

Cursor.Tree.Swap

Synopsis

Documentation

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
Functor SwapResult Source # 
Instance details

Defined in Cursor.Tree.Swap

Methods

fmap :: (a -> b) -> SwapResult a -> SwapResult b #

(<$) :: a -> SwapResult b -> SwapResult a #

Eq a => Eq (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

Methods

(==) :: SwapResult a -> SwapResult a -> Bool #

(/=) :: SwapResult a -> SwapResult a -> Bool #

Show a => Show (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

Generic (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

Associated Types

type Rep (SwapResult a) :: Type -> Type #

Methods

from :: SwapResult a -> Rep (SwapResult a) x #

to :: Rep (SwapResult a) x -> SwapResult a #

NFData a => NFData (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

Methods

rnf :: SwapResult a -> () #

Validity a => Validity (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

type Rep (SwapResult a) Source # 
Instance details

Defined in Cursor.Tree.Swap

type Rep (SwapResult a) = D1 (MetaData "SwapResult" "Cursor.Tree.Swap" "cursor-0.3.0.0-4Hn80vYAl979Qxk54M4vdL" False) (C1 (MetaCons "SwapperIsTopNode" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "NoSiblingsToSwapWith" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Swapped" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))))