<div dir="ltr">Un break est bien sûr pertinent en terme de perfs, car tu ne parcours la liste source qu'une fois.<div><br></div><div>Par contre, si tu as vraiment d'importantes contraintes de performances, il faudra travailler d'une façon totalement différente. En particulier, il y a fort à parier qu'il ne soit pas possible de charger tout le fichier en mémoire!</div></div><div class="gmail_extra"><br><div class="gmail_quote">Le 23 juin 2017 à 10:48, Marc Chantreux <span dir="ltr"><<a href="mailto:khatar@phear.org" target="_blank">khatar@phear.org</a>></span> a écrit :<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hello,<br>
<span class=""><br>
On Thu, Jun 22, 2017 at 05:46:17PM +0200, Simon Marechal wrote:<br>
>    let (lvotes,lcandidats) = break (== "0") lignes<br>
>         votes = ... a<br>
>         candidats = map read (drop 1 lcandidats) -- ça marche avec<br>
> l'exemple que tu as donné ;)<br>
<br>
</span>certes mais je produits un lvotes qui ne sera jamais utilisé que pour<br>
produire votes. idem pour lcandidats.<br>
<br>
est-ce pertinent en terme de perf ? est-ce plus rapide de faire break<br>
plutot que takeWhile puis dropWhile ?<br>
<span class=""><br>
> Mais oui, dans l'absolu faut parser correctement ...<br>
<br>
</span>dans mes reves les plus fous, je pousse un parser BLT sur hackage dans<br>
qq temps.<br>
<br>
merci en tout cas pour les commentaires.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Marc Chantreux (eiro on github and freenode)<br>
<a href="http://eiro.github.com/" rel="noreferrer" target="_blank">http://eiro.github.com/</a><br>
<a href="http://eiro.github.com/atom.xml" rel="noreferrer" target="_blank">http://eiro.github.com/atom.<wbr>xml</a><br>
"Don't believe everything you read on the Internet"<br>
    -- Abraham Lincoln<br>
______________________________<wbr>_________________<br>
Haskell-fr mailing list<br>
<a href="mailto:Haskell-fr@haskell.org">Haskell-fr@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-fr" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>fr</a><br>
</div></div></blockquote></div><br></div>