trait
TreeOps[Tree, Label] extends AnyRef
Type Members
-
abstract
type
Node
-
-
Abstract Value Members
-
abstract
def
children(node: Node): Iterable[Node]
-
abstract
def
label(node: Node): Label
-
abstract
def
root(t: Tree): Option[Node]
Concrete Value Members
-
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
clone(): AnyRef
-
-
-
def
finalize(): Unit
-
def
fold[A](tree: Tree)(f: (Label, Iterable[Node]) ⇒ A): Option[A]
-
def
fold[A](node: Node)(f: (Label, Iterable[Node]) ⇒ A): A
-
final
def
getClass(): Class[_]
-
def
hashCode(): Int
-
final
def
isInstanceOf[T0]: Boolean
-
-
final
def
notify(): Unit
-
final
def
notifyAll(): Unit
-
def
reduce[A](tree: Tree)(f: (Label, Iterable[A]) ⇒ A): Option[A]
-
def
reduce[A](node: Node)(f: (Label, Iterable[A]) ⇒ A): A
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
-
def
toString(): String
-
final
def
wait(): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
-
final
def
wait(arg0: Long): Unit
TreeOps is a type class for abstracting over arbitrary trees, allowing traversal and data access. In general, it assumes that we can quickly access the children and label of any given node.
There are some convenience implicit methods added onto trees and nodes that can be accessed by importing tree ops. For instance, say we wanted to add an implicit method to any type of tree that let's us find some node in a tree.