Skip to content

Commit

Permalink
Merge pull request #6 from joelberkeley/pair
Browse files Browse the repository at this point in the history
implement `Hashable` for `Pair`
  • Loading branch information
Z-snails authored Sep 22, 2022
2 parents d97d2c3 + 18b5cc1 commit 2e522ad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Data/Hashable.idr
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ Hashable Bool where

hashWithSalt = defaultHashWithSalt hash

export
(Hashable a, Hashable b) => Hashable (a, b) where
hashWithSalt salt (a, b) = salt `hashWithSalt` a `hashWithSalt` b

export
Hashable a => Hashable (Maybe a) where
hashWithSalt salt Nothing = hashWithSalt salt 0
Expand Down

0 comments on commit 2e522ad

Please sign in to comment.