-- Define a reflexive binary relation data SameColor p q instance Reflexive SameColor
newtype Bob = Bob Defn bob :: Int ~~ Bob bob = defn 42 needsBob :: (Int ~~ Bob) -> Int needsBob x = the x + the x isBob :: (Int ~~ name) -> Maybe (Proof (name == Bob)) isBob = same x bob f :: (Int ~~ name) -> Int f x = case reflectEq <$> isBob x of Nothing -> 17 Just Refl -> needsBob x x
-- Define an irreflexive binary relation newtype DifferentColor p q = DifferentColor Defn type role DifferentColor nominal nominal instance Irreflexive DifferentColor