X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=topics%2F_week4_fixed_point_combinator.mdwn;fp=topics%2F_week4_fixed_point_combinator.mdwn;h=17b7b1c368d8eb52c2cdf51715a27d31b3c010e0;hp=28e310eddeb634f36a4b884e75149466076ee11e;hb=ee6a2e3f2edbc040298165943d874423d866bbc6;hpb=a197bd74076e29d014d10dcf1040cf8aea455914 diff --git a/topics/_week4_fixed_point_combinator.mdwn b/topics/_week4_fixed_point_combinator.mdwn index 28e310ed..17b7b1c3 100644 --- a/topics/_week4_fixed_point_combinator.mdwn +++ b/topics/_week4_fixed_point_combinator.mdwn @@ -1,5 +1,14 @@ [[!toc]] +#Recursion: fixed points in the lambda calculus## + +Sometimes when you type in a web search, Google will suggest +alternatives. For instance, if you type in "Lingusitics", it will ask +you "Did you mean Linguistics?". But the engineers at Google have +added some playfulness to the system. For instance, if you search for +"anagram", Google asks you "Did you mean: nag a ram?" And if you +search for "recursion", Google asks: "Did you mean: recursion?" + ##What is the "rec" part of "letrec" doing?## How could we compute the length of a list? Without worrying yet about what lambda-calculus implementation we're using for the list, the basic idea would be to define this recursively: