Skip to content

Instantly share code, notes, and snippets.

@davidhoyt
davidhoyt / ringAroundTheMonad.scala
Last active August 29, 2015 14:27 — forked from trane/ringAroundTheMonad.scala
playing with Coyoneda+Free Monad for algebraic Rings.. and funsies
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]