Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created April 5, 2013 16:41
Show Gist options
  • Save joshcough/5320729 to your computer and use it in GitHub Desktop.
Save joshcough/5320729 to your computer and use it in GitHub Desktop.
implicit def varEqual1[A:Equal]: Equal1[({type λ[α] = Var[A,α]})#λ] = new Equal1[({type λ[α] = Var[A,α]})#λ] {
def equal[B](a1: ({type λ[α] = Var[A,α]})#λ[B], a2: ({type λ[α] = Var[A,α]})#λ[B])(implicit a: Equal[B]): Boolean =
implicitly[Equal[({type λ[α] = Var[A,α]})#λ[B]]].equal(a1, a1)
}
@runarorama
Copy link

Compare with:

instance Eq a => Eq1 (Var a) where { x === y = x == y }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment