effect-tree
    Preparing search index...

    Function depthFirst

    • Navigate from a node to the next node in a depth-first pre-order traversal, where parents are visited before their children, and both are visited before the next sibling of the parent. For example:

      For the tree:
                        ┌─┐
                        │1│
                   ╭────┴─┴─────╮
                 ┌─┴─┐        ┌─┴─┐
                 │1.1│        │1.2│
               ╭─┴───┴╮      ╭┴───┴─╮
            ┌──┴──┐┌──┴──┐┌──┴──┐┌──┴──┐
            │1.1.1││1.1.2││1.2.1││1.2.2│
            └─────┘└─────┘└─────┘└─────┘
      
           depthFirst ┊ result of
          called on...┊ navigation
          ┈┈┈┈┈┈┈┈┈┈┈┈┼┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
                 “1”  ┊ “1.1”
               “1.1”  ┊ “1.2”
               “1.2”  ┊ “1.1.1”
             “1.1.1”  ┊ “1.1.2”
             “1.2.1”  ┊ “1.2.2”
             “1.2.2”  ┊ Exception thrown
      

      Returns Option.none when the final node in the traversal has been reached.

      This is the unsafe version of tryDepthFirst.

      Type Parameters

      • A

        The underlying type of the tree.

      Parameters

      Returns Zipper.Zipper<A>

      An updated zipper pointing at a new focus.