Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Created March 16, 2012 10:15
Show Gist options
  • Select an option

  • Save missingfaktor/2049420 to your computer and use it in GitHub Desktop.

Select an option

Save missingfaktor/2049420 to your computer and use it in GitHub Desktop.
trait Expr[+A] { a =>
def =:=[B](b: Expr[B]): Expr[Boolean] = BinOp[Boolean, A, B](a, b, _ == _, "=:=")
def <[B >: A](b: Expr[B])(implicit ord: scala.Ordering[B]): Expr[Boolean] = {
BinOp[Boolean, B, B](a, b, ord.lt, "<")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment