<div dir="ltr">I've changed the "if minimum < 3" line with an "any (< 3)" line. This has sped up the performance to be good enough. (I assume that I have to calculate the Lev. distance of all the 9-mers in order to take the minimum. I really only care if any element has a Lev. distance less than three, so I can stop when I find the first.) The rest of this discussion is purely for fun.<div><br></div><div>I've swapped "y:ys" for "ys ++ [y]", and while the output is reversed, I don't appear to be able to take the first n elements still. I haven't timed how long the program takes now to see if it blows up. Rein, I don't quite understand your answer; I may need you to be more explicit if I don't figure this out. Part of what confuses me is that the recursion takes place in merge, and the (:) is in addInto. I think your comment has given me an idea, so I'm going to take some time to play with this in the afternoon, so I'll send an update tonight.</div><div><br></div><div>Thanks for looking at this!</div><div>-- Mason</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 21, 2016 at 11:05 AM, Rein Henrichs <span dir="ltr"><<a href="mailto:rein.henrichs@gmail.com" target="_blank">rein.henrichs@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">s/not/note, sorry</div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 21, 2016 at 10:42 AM Rein Henrichs <<a href="mailto:rein.henrichs@gmail.com" target="_blank">rein.henrichs@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="ltr">But not that doing so will cause the program to have an exponential runtime as each new ys must be repeatedly traversed to append a [y].. The alternative is to *unfold* your list by recursing on the right hand side of the (:) to add new elements.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 21, 2016 at 5:43 AM Doug McIlroy <<a href="mailto:doug@cs.dartmouth.edu" target="_blank">doug@cs.dartmouth.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Each time you find another good 9-mer, you add it to<br>
the head of the list. This means that the ultimate<br>
list will be in reverse order of discovery: the first element<br>
to be printed is the last one to be found. To get<br>
output in the order it was discovered, build the<br>
output by ys++[y] rather than y:ys.<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div></blockquote></div>
</div></div></blockquote></div><br></div>