Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Last active October 12, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/43bc133b667f509c7538 to your computer and use it in GitHub Desktop.
Save adilakhter/43bc133b667f509c7538 to your computer and use it in GitHub Desktop.
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