Last active
October 12, 2015 13:22
-
-
Save adilakhter/43bc133b667f509c7538 to your computer and use it in GitHub Desktop.
A companion object to Tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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