Last active
August 29, 2015 14:14
-
-
Save abevoelker/2899d92473d1b01fd9f9 to your computer and use it in GitHub Desktop.
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
data Tree = Empty | |
| Leaf Int | |
| Node Tree 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
sealed trait Tree[T] | |
case object Empty extends Tree[Nothing] | |
case class Leaf[T](value: T) extends Tree[T] | |
case class Node[T](left: Tree[T], right: Tree[T]) extends Tree[T] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment