One annoying with an MPTC approach is that suddenly defaulting stops working.<div><br></div><div>This can result in a requiring of a lot more signatures from users or little helpers everywhere like the &#39;sip&#39; below.<div>
<br></div><div>-Edward<br><div><div><br><div class="gmail_quote">On Thu, Mar 21, 2013 at 10:36 AM, Bas van Dijk <span dir="ltr">&lt;<a href="mailto:v.dijk.bas@gmail.com" target="_blank">v.dijk.bas@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 21 March 2013 06:54, wren ng thornton &lt;<a href="mailto:wren@freegeek.org">wren@freegeek.org</a>&gt; wrote:<br>

&gt; One concern with the above approach: is &quot;siphash&quot; a sufficiently generic<br>
&gt; name, or is it just one hashing method that happens to deflect this DoS<br>
&gt; issue? I haven&#39;t read the paper, so...<br>
<br>
</div>One could of course generalize the above method using something like:<br>
<br>
-- A type hashed as h<br>
newtype Hashed h a = Hashed a<br>
<br>
instance (HashableAs h a) =&gt; Hashable (Hashed h a) where<br>
  hashWithSalt = hashWithSaltAs<br>
<br>
class HashableAs h a where<br>
  hashWithSaltAs :: Int -&gt; Hashed h a -&gt; Int<br>
<br>
data Sip<br>
<br>
sip :: a -&gt; Hashed Sip a<br>
sip = Hashed<br>
<br>
instance HashableAs Sip Text where<br>
  hashWithSaltAs salt (Hashed x) = sipHashWithSalt salt x<br>
<br>
instance HashableAs Sip ByteString where<br>
  ...<br>
<br>
Regards,<br>
<br>
Bas<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/libraries" target="_blank">http://www.haskell.org/mailman/listinfo/libraries</a><br>
</div></div></blockquote></div><br></div></div></div></div>