HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Modulecursor-0.3.2.0Haskell2010

Cursor.Tree.Demote

  • 1 type
  • 4 values
  • Packagecursor-0.3.2.0
  • Exports5
  • LanguageHaskell2010
  • LicenceMIT
  • SourceDemote.hs
datadata DemoteResult a
#
Instances7Functor, Eq, Show, Generic, NFData, Validity, …
valuetreeCursorDemoteElemUnder
  1. :: b
  2. -> b
  3. -> TreeCursor a b
  4. -> Maybe (TreeCursor 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:

 p
 |- a <--
    |- b

After:

 p
 |- <given element 1>
 |  |- a <--
 |- <given element 2>
 |  |- b