<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 15, 2015 at 6:38 PM, Ben Gunton <span dir="ltr"><<a href="mailto:ben.gunton@gmail.com" target="_blank">ben.gunton@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">When I write a function with the type constraint "embedded" in the function's type declaration, instead of at the beginning, the function takes longer each time it is run. The simplest example I could write is this: <a href="http://lpaste.net/134563" target="_blank">http://lpaste.net/134563</a><div style="display:inline-block;width:16px;height:16px"> </div>. "run1" is near instantaneous the first time, but gets marginally slower after each iteration... after thousands of iterations it takes about a millisecond to run (and keeps getting worse). "run2" is always near instantaneous. What is happening in "run1" that makes it slow down?</div></blockquote></div><br>Something about having to make a typeclass dictionary for each iteration?<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>