feat: add Hashable instance for Char (#5747)

I needed this in downstream code, and it seems to make the most sense to
just contribute it here.
This commit is contained in:
David Thrane Christiansen 2024-10-17 16:46:10 +02:00 committed by GitHub
parent fc5e3cc66e
commit d6a7eb3987
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,6 +51,9 @@ instance : Hashable USize where
instance : Hashable (Fin n) where
hash v := v.val.toUInt64
instance : Hashable Char where
hash c := c.val.toUInt64
instance : Hashable Int where
hash
| Int.ofNat n => UInt64.ofNat (2 * n)