From: jim Date: Thu, 23 Apr 2015 13:23:21 +0000 (-0400) Subject: remove header X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=5384f5fa696d6cab065d66f73df450fe7e0ae7db;ds=sidebyside remove header --- diff --git a/topics/week12_abortable_traversals.mdwn b/topics/week12_abortable_traversals.mdwn index 70949bf7..59d55170 100644 --- a/topics/week12_abortable_traversals.mdwn +++ b/topics/week12_abortable_traversals.mdwn @@ -1,5 +1,3 @@ -## Aborting a search through a list ## - We've talked about different implementations of lists in the Lambda Calculus; and we've also talked about using lists to implement other data structures, like sets. One thing we observed is that if you're going to implement a set using a list (this isn't an especially efficient implementation of a set, but let's do the best we can with it), it's helpful to make sure that the list is always sorted. That way, as you're searching through the list, you might come to a point before the end where you knew the element you're looking for wasn't going to be found anymore. So you wouldn't have to continue the search. If you were implementing lists with `letrec` or a fixed point combinator, then at that point you could just have your traversal function return some appropriate result, instead of requesting that the recursion continue.