effect-tree - v1.0.36
    Preparing search index...

    Function replaceFolder

    • Converts a fold φ into one that replaces tree values: every tree node will be replaced with the intermediate value of the fold at the node.

      For example, to convert the descendantCount fold, that folds a tree into a tree total descendant count to one where each node value is the node total descendant count:

      const replaced = pipe(
      tree(42, [leaf(43)]),
      self, treeCata(replaceFolder(folds.descendantCount))),
      )

      Type Parameters

      • A
      • B

      Parameters

      Returns TreeFolder<A, Tree<B>>