Demotes the current node to the level of its children.
Example:
Before:
p
|- a
| |- b
|- c <--
| |- d
|- eAfter:
p
|- a
| |- b
| |- c <--
| |- d
|- e:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulecursor-0.3.2.0Haskell2010
Demotes the current node to the level of its children.
Example:
Before:
p
|- a
| |- b
|- c <--
| |- d
|- eAfter:
p
|- a
| |- b
| |- c <--
| |- d
|- eDemotes the current subtree to the level of its children.
Example:
Before:
p
|- a
| |- b
|- c <--
| |- d
|- eAfter:
p
|- a
| |- b
| |- c <--
| |- d
|- eFunctor DemoteResultDefined in cursor-0.3.2.0 · Cursor.Tree.DemoteEq a => Eq (DemoteResult a)Defined in cursor-0.3.2.0 · Cursor.Tree.DemoteShow a => Show (DemoteResult a)Defined in cursor-0.3.2.0 · Cursor.Tree.DemoteGeneric (DemoteResult a)Defined in cursor-0.3.2.0 · Cursor.Tree.DemoteNFData a => NFData (DemoteResult a)Defined in cursor-0.3.2.0 · Cursor.Tree.DemoteValidity a => Validity (DemoteResult a)Defined in cursor-0.3.2.0 · Cursor.Tree.Demotetype Rep (DemoteResult a) = D1 ('MetaData "DemoteResult"
"Cursor.Tree.Demote"
"cursor-0.3.2.0-F9X8WOAtgDl2Ee7ztttX2k"
'False) (C1 ('MetaCons "CannotDemoteTopNode"
'PrefixI 'False) U1 :+: (C1 ('MetaCons "NoSiblingsToDemoteUnder"
'PrefixI 'False) U1 :+: C1 ('MetaCons "Demoted"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))))Defined in cursor-0.3.2.0 · Cursor.Tree.DemoteDemotes 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 <--
|- bAfter:
p
|- <given element 1>
| |- a <--
|- <given element 2>
| |- bDemotes the current subtree to the level of its children, by adding a root.
Example:
Before:
a <--
|- bAfter:
<given element>
|- a <--
|- b