X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=lambda_library.mdwn;h=0c00c4508e5f7d62c4b79086aec13cfc30769229;hp=579668bed6323e3a976b8a70d599f537a82fbcca;hb=5b055e3d14fb38977001a787df550795d4b3ad36;hpb=8ef02c87c6608f870322ca38033c372b50890ef2 diff --git a/lambda_library.mdwn b/lambda_library.mdwn index 579668be..0c00c450 100644 --- a/lambda_library.mdwn +++ b/lambda_library.mdwn @@ -329,5 +329,9 @@ let list_equal = ) ; when fold is finished, check sofar-pair (\might_be_equal right_tail. and might_be_equal (isempty right_tail)) + +; most elegant +let list_equal = \lst. lst (\hd sofar. \lst. and (and (not (isempty lst)) (eq hd (head lst))) (sofar (tail lst))) isempty + -->