Proposal: Add Semigroup and Monoid instances for (:~:)

David Feuer david.feuer at
Wed Jan 13 05:58:17 UTC 2016

These are not likely to be *useful*, but they fall easily into the
general bucket of "exactly one sensible instance exists".

instance Semigroup (a :~: b) where
  r <> _ = r

instance a ~ b => Monoid (a :~: b) where
  mempty = Refl
  mappend r _ = r

More information about the Libraries mailing list