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
import algebra._, std.int._ | |
import cats._, free._, Free._ | |
import scala.language.implicitConversions | |
trait Expr[A] | |
case class Const[A](term: A) extends Expr[A] | |
case class Add[A](e1: Expr[A], e2: Expr[A])(implicit val r: Ring[A]) extends Expr[A] | |
type Exp[A] = FreeC[Expr, A] |