diff options
author | Jon Pretty <jon.pretty@propensive.com> | 2017-11-01 11:36:14 +0100 |
---|---|---|
committer | Jon Pretty <jon.pretty@propensive.com> | 2017-11-01 11:36:14 +0100 |
commit | 25fb02b13b721004269f9bd9a4e5d22c2bb219c4 (patch) | |
tree | adeb4ff353d959dfa14e17d726b0d2f939ab2b3e /examples/src/main/scala/typeclasses.scala | |
parent | 88f36a7a552246e210266a7ae82a2e480718512e (diff) | |
download | magnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.tar.gz magnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.tar.bz2 magnolia-25fb02b13b721004269f9bd9a4e5d22c2bb219c4.zip |
Support for GADTs (including recursive ones)
Some tests still failing, but macros are working
Diffstat (limited to 'examples/src/main/scala/typeclasses.scala')
-rw-r--r-- | examples/src/main/scala/typeclasses.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/examples/src/main/scala/typeclasses.scala b/examples/src/main/scala/typeclasses.scala index 589a075..440c5bc 100644 --- a/examples/src/main/scala/typeclasses.scala +++ b/examples/src/main/scala/typeclasses.scala @@ -81,10 +81,9 @@ object Decoder { trait Decoder[T] { def decode(str: String): T } -sealed trait Tree -case class Leaf(value: String) extends Tree -case class Branch(left: Tree, right: Tree) extends Tree -case object Bud extends Tree +sealed trait Tree[+T] +case class Leaf[+L](value: L) extends Tree[L] +case class Branch[+B](left: Tree[B], right: Tree[B]) extends Tree[B] sealed trait Entity |