Skip to content

Instantly share code, notes, and snippets.

@abevoelker
Last active August 29, 2015 14:14
Show Gist options
  • Save abevoelker/2899d92473d1b01fd9f9 to your computer and use it in GitHub Desktop.
Save abevoelker/2899d92473d1b01fd9f9 to your computer and use it in GitHub Desktop.
data Tree = Empty
| Leaf Int
| Node Tree Tree
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