<div dir="auto">That won't help whatsoever in most cases. The matter has been discussed several times with no progress. If you want to add RULES for Int8, Int16, ..., Word, Word8, ..., and Natural to match the ones for Int and Integer, that would make sense, but the basic problem will remain for unmentioned types.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018, 10:24 PM Vanessa McHale <<a href="mailto:vanessa.mchale@iohk.io">vanessa.mchale@iohk.io</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>This is perhaps not the right place, but if there are benchmarks
proving that genericLength is slower than it should be, it should
be easy to add a <tt>SPECIALIZE</tt> pragma. <br>
</p>
<div class="m_2827204674479436978moz-cite-prefix">On 11/13/18 9:13 PM, David Feuer wrote:<br>
</div>
<blockquote type="cite">
<div dir="auto">genericLength is extremely inefficient for typical
numeric types. Int is a rather sad type for these things; it
really should be Word. But that may not be worth fixing.</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, Nov 13, 2018, 9:51 PM Evan Laforge <<a href="mailto:qdunkan@gmail.com" target="_blank" rel="noreferrer">qdunkan@gmail.com</a>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can
already get these as Data.List.genericLength and<br>
Data.List.genericReplicate<br>
<br>
As for changing the prelude ones, this would probably cause a
lot of<br>
busywork. Where I work we compile with -Werror and
-Wtype-defaults,<br>
so a lot of places might have to get type annotations.<br>
On Tue, Nov 13, 2018 at 5:19 PM Vanessa McHale <<a href="mailto:vanessa.mchale@iohk.io" rel="noreferrer noreferrer" target="_blank">vanessa.mchale@iohk.io</a>>
wrote:<br>
><br>
> Would it be possible to generalize replicate and length
to have type<br>
> signatures<br>
><br>
> replicate :: Integral a => a -> b -> [b]<br>
><br>
> and<br>
><br>
> length :: (Integral a, Foldable t) => t b -> a<br>
><br>
> ?<br>
><br>
> There have been a few instances where such a thing would
have been<br>
> useful to me.<br>
><br>
> Cheers<br>
><br>
><br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" rel="noreferrer noreferrer" target="_blank">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
</blockquote>
</div>
</blockquote></div>