Proposal: Add the unordered-containers package and the hashable package to the Haskell Platform

Edward Kmett ekmett at gmail.com
Fri Mar 22 06:30:51 CET 2013


One annoying with an MPTC approach is that suddenly defaulting stops
working.

This can result in a requiring of a lot more signatures from users or
little helpers everywhere like the 'sip' below.

-Edward

On Thu, Mar 21, 2013 at 10:36 AM, Bas van Dijk <v.dijk.bas at gmail.com> wrote:

> On 21 March 2013 06:54, wren ng thornton <wren at freegeek.org> wrote:
> > One concern with the above approach: is "siphash" a sufficiently generic
> > name, or is it just one hashing method that happens to deflect this DoS
> > issue? I haven't read the paper, so...
>
> One could of course generalize the above method using something like:
>
> -- A type hashed as h
> newtype Hashed h a = Hashed a
>
> instance (HashableAs h a) => Hashable (Hashed h a) where
>   hashWithSalt = hashWithSaltAs
>
> class HashableAs h a where
>   hashWithSaltAs :: Int -> Hashed h a -> Int
>
> data Sip
>
> sip :: a -> Hashed Sip a
> sip = Hashed
>
> instance HashableAs Sip Text where
>   hashWithSaltAs salt (Hashed x) = sipHashWithSalt salt x
>
> instance HashableAs Sip ByteString where
>   ...
>
> Regards,
>
> Bas
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20130322/7020c7c5/attachment.htm>


More information about the Libraries mailing list