basvandijk / case-insensitive

Case insensitive string comparison
Other
25 stars 19 forks source link

case-insensitive should have a Hashable instance #1

Closed gregorycollins closed 13 years ago

gregorycollins commented 13 years ago

See http://hackage.haskell.org/package/hashable

This is something we're going to need at some point for Snap.

basvandijk commented 13 years ago

I assume that you need the hash of a CI s to be the hash of the case folded s. So:

instance Hashable s => Hashable (CI s) where
  hash = hash . foldedCase

Right?

gregorycollins commented 13 years ago

Yeah, looks good to me!

On Wed, Jul 13, 2011 at 5:51 AM, basvandijk reply@reply.github.com wrote:

I assume that you need the hash of a CI s to be the hash of the case folded s. So:

   instance Hashable s => Hashable (CI s) where      hash = hash . foldedCase

Right?

Reply to this email directly or view it on GitHub: https://github.com/basvandijk/case-insensitive/issues/1#issuecomment-1561453

Gregory Collins greg@gregorycollins.net

basvandijk commented 13 years ago

Done