<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Yu Gothic";
        panose-1:2 11 4 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@Yu Gothic";
        panose-1:2 11 4 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style>
<div class="WordSection1">
<p class="MsoNormal">I spoke too soon, I failed to consider that such a proposal must have been under consideration many times before, and there must have been a good reason for it to not to move forward.<br>
<br>
Adding RULES for the most commonly used integer types is probably a good place to start, but perhaps I am mistaken.
</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Libraries <libraries-bounces@haskell.org> on behalf of David Feuer <david.feuer@gmail.com><br>
<b>Sent:</b> Wednesday, November 14, 2018 3:30:38 AM<br>
<b>To:</b> Vanessa McHale<br>
<b>Cc:</b> Haskell Libraries<br>
<b>Subject:</b> Re: Generalizing some type signatures involving Int</font>
<div> </div>
</div>
<div>
<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>
</div>
</body>
</html>