<div><div><div dir="auto">At any rate, using binary search doesn’t automatically guarantee faster runtime. Constant factors can add up, and there might not even be enough elements to warrant binary search. Benchmarking on realistic data is definitely a good idea.</div></div></div><div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 21, 2019 at 11:39 AM David Feuer <<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Case matching is already optimized in GHC. There might be ways to improve it, but it already uses binary search and/or jump tables to improve performance when there are many branches.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 21, 2019, 8:59 AM olexandr543--- via Haskell <<a href="mailto:haskell@haskell.org" target="_blank">haskell@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px"><div dir="ltr"><div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px">Hello!</div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px"><br></div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px">My library that can help to optimize using 'case ... of ...' construction if there are multiple (more than at least 5) variants.</div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px"><a href="http://hackage.haskell.org/package/mm2" style="color:rgb(25,106,212);text-decoration-line:underline" rel="nofollow noreferrer" target="_blank">mm2: The library that can be used for optimization of multiple (Ord a) => a -> b transformations</a></div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px"><br></div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px">Best regards,</div><div dir="ltr" style="font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px">Oleksandr Zhabenko.</div><div><br></div></div><br></div></div></div>_______________________________________________<br>
Haskell mailing list<br>
<a href="mailto:Haskell@haskell.org" rel="noreferrer" target="_blank">Haskell@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell</a><br>
</blockquote></div>
_______________________________________________<br>
Haskell mailing list<br>
<a href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell</a><br>
</blockquote></div></div>
</div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><img src="https://raw.githubusercontent.com/btjanaka/namelogo/master/build/logo/bt-logo-color-no-border-no-bkgd-80.png" alt="logo" style="height:90px;display:inline-block;float:left;margin:0px;padding:5px 10px;border-right:1px solid rgb(224,224,224)"></p><div style="height:100px;margin:0px;padding:0px;color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><div style="display:inline-block;height:90px;margin:0px;padding-left:12px;padding-top:15px"><p style="font-family:sans-serif;font-weight:bold;font-size:14px;margin:0px">Bryon Tjanaka</p><p style="font-family:sans-serif;font-size:12px;color:rgb(100,100,100);margin:3px 0px"><i>"Audentes fortuna iuvat"</i></p><a href="https://btjanaka.net" style="display:block;font-family:sans-serif;font-size:12px;color:rgb(100,100,100);margin:3px 0px" target="_blank">btjanaka.net</a><a href="https://github.com/btjanaka" style="display:block;font-family:sans-serif;font-size:12px;color:rgb(100,100,100);margin:3px 0px" target="_blank">github.com/btjanaka</a></div></div></div></div>