Trees

trait Trees

Utility methods for scalaz Trees

Companion:
object
class Object
trait Matchable
class Any
object Trees.type

Type members

Classlikes

implicit class CleanedTree[A](t: Tree[Option[A]])

This implicit can be used to remove None nodes in a Tree

This implicit can be used to remove None nodes in a Tree

implicit class TreeLocx[T](t: TreeLoc[T])

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

implicit class Treex[A](t: Tree[A])

Implicit definition to add more functionalities to the Tree trait

Implicit definition to add more functionalities to the Tree trait

Value members

Concrete methods

def allPaths[A](tree: Tree[A]): List[List[A]]
Returns:

all the paths from root to leaves

def bottomUp[A, B](t: Tree[A], f: (A, Stream[B]) => B): Tree[B]

map a Tree from leaves to root by replacing each node with the result of a function taking that node and the mapping of all its children.

map a Tree from leaves to root by replacing each node with the result of a function taking that node and the mapping of all its children.

This is used in JUnit to map a Tree[Description] where no Description objects are related to a Tree[Description] where each node returns the children nodes on the "getChildren" method

def clean[A](t: Tree[Option[A]])(implicit initial: A): Tree[A]

remove None nodes from a tree

remove None nodes from a tree

def flattenSubForests[A](tree: Tree[A]): Tree[A]
def parentLocs[T](t: TreeLoc[T], ps: Seq[TreeLoc[T]]): Seq[TreeLoc[T]]
Returns:

the list of all parent locs from a given TreeLoc

def prune[A, B](t: Tree[A], f: A => Option[B]): Option[Tree[B]]

remove nodes from a tree if they are None according to a function f

remove nodes from a tree if they are None according to a function f

def prune[A](t: Tree[A], f: Tree[A] => Option[A])(implicit initial: A): Tree[A]

remove nodes from a tree if they are None according to a function f

remove nodes from a tree if they are None according to a function f

def size[A](t: TreeLoc[A]): Int
Returns:

the number of nodes in a TreeLoc

Implicits

Implicits

final implicit def CleanedTree[A](t: Tree[Option[A]]): CleanedTree[A]

This implicit can be used to remove None nodes in a Tree

This implicit can be used to remove None nodes in a Tree

final implicit def TreeLocx[T](t: TreeLoc[T]): TreeLocx[T]

Implicit definition to add more functionalities to the TreeLoc class

Implicit definition to add more functionalities to the TreeLoc class

final implicit def Treex[A](t: Tree[A]): Treex[A]

Implicit definition to add more functionalities to the Tree trait

Implicit definition to add more functionalities to the Tree trait

implicit def treeIsSized[T]: Sized[Tree[T]]
implicit def treeLocIsSized[T]: Sized[TreeLoc[T]]