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:
parent
fc5e3cc66e
commit
d6a7eb3987
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue