A companion object to Tree
object Tree{ | |
def empty[A]: Tree[A] = EmptyTree | |
def node[A](value: A, left: Tree[A] = empty, right: Tree[A] = empty): Tree[A] | |
= Node(value, left, right) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment