From: Jim Date: Sun, 1 Feb 2015 15:36:40 +0000 (-0500) Subject: week1 refinements X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=9ca52fa8a329edc6975f0aa19856a4a8d782ad77;hp=2ad0964b1abb9ac6b49ca5dab5ae1b95a967d75a week1 refinements --- diff --git a/topics/week1.mdwn b/topics/week1.mdwn index 0bbea4ea..725c4d18 100644 --- a/topics/week1.mdwn +++ b/topics/week1.mdwn @@ -383,8 +383,8 @@ is a pattern, meaning the same as `x1 & x2 & []`. Note that while `x & xs` match For the time being, these are the only patterns we'll allow. But since the definition of patterns is recursive, this permits very complex patterns. What would this evaluate to: let - ([x, y], [z:zs, w]) match ([[], [1]], [[10, 20, 30], [0]]) - in (z, y) + ([xs, ys], [z:zs, ws]) match ([[], [1]], [[10, 20, 30], [0]]) + in z & ys Also, we will permit complex patterns in λ-expressions, too. So you can write: