Created
March 8, 2016 20:50
-
-
Save julien-truffaut/45ae3ceab4113651c8a8 to your computer and use it in GitHub Desktop.
Algebra encoding
This file contains hidden or 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 Alg1[A] | |
case class Foo1(s: String) extends Alg1[Int] | |
case object Bar1 extends Alg1[Boolean] | |
sealed trait Alg2[A] | |
case class Foo2[A](s: String, f: String => A) extends Alg2[A] | |
case class Bar[A](f: Boolean => A) extends Alg2[A] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment