Safe FFI between Rust and C++
diff --git a/syntax/impls.rs b/syntax/impls.rs
new file mode 100644
index 0000000..8153f03
--- /dev/null
+++ b/syntax/impls.rs
@@ -0,0 +1,31 @@
+use crate::syntax::{Ref, Ty1};
+use std::hash::{Hash, Hasher};
+
+impl Eq for Ty1 {}
+
+impl PartialEq for Ty1 {
+    fn eq(&self, other: &Ty1) -> bool {
+        self.name == other.name && self.inner == other.inner
+    }
+}
+
+impl Hash for Ty1 {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.name.hash(state);
+        self.inner.hash(state);
+    }
+}
+
+impl Eq for Ref {}
+
+impl PartialEq for Ref {
+    fn eq(&self, other: &Ref) -> bool {
+        self.inner == other.inner
+    }
+}
+
+impl Hash for Ref {
+    fn hash<H: Hasher>(&self, state: &mut H) {
+        self.inner.hash(state);
+    }
+}