Skip to content

Instantly share code, notes, and snippets.

@rightfold

rightfold/eq.vl Secret

Last active September 12, 2015 21:57
Show Gist options
  • Save rightfold/66ac5d2c5acd7324b75c to your computer and use it in GitHub Desktop.
Save rightfold/66ac5d2c5acd7324b75c to your computer and use it in GitHub Desktop.
import vlinder.logic
import vlinder.text
typeclass Eq[T: *] {
eq: (T, T) => logic.T
}
sub ne[T: * where Eq[T]](a: T, b: T): logic.T {
!(a == b)
}
typeclassinstance Eq[logic.T] {
sub eq(a: logic.T, b: logic.T): logic.T {
...
}
}
typeclassinstance Eq[text.T] {
sub eq(a: text.T, b: text.T): logic.T {
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment