<div dir="auto">You still haven't said why you need this. Only a rather exotic data structure is likely to have a length greater than maxBound @Int.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 13, 2018, 10:23 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">I want more than this, actually. genericLength doesn't work over any<br>
Foldable.<br>
<br>
On 11/13/18 8:50 PM, Evan Laforge wrote:<br>
> 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" target="_blank" rel="noreferrer">vanessa.mchale@iohk.io</a>> wrote:<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" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
>> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
<br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank" rel="noreferrer">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote></div>