"inner" expression
authorjim <jim@web>
Mon, 9 Feb 2015 00:22:57 +0000 (19:22 -0500)
committerLinux User <ikiwiki@localhost.members.linode.com>
Mon, 9 Feb 2015 00:22:57 +0000 (19:22 -0500)
topics/week3_lists.mdwn

index 8d646f1..14663cd 100644 (file)
@@ -88,7 +88,7 @@ This gives us nearly what we want. It evaluates to:
 
     [[14, 24, 34], [15, 25, 35]]
 
 
     [[14, 24, 34], [15, 25, 35]]
 
-Why? Because the `filter` expression at the end is restricting the domain that `y` ranges over to `[4, 5]`. Over this domain we are selecting a value to bind `y` to, and then evaluating the inner `map` expression with `y` so bound. With `y` bound to `4`, we get the result `[14, 24, 34]`. With `y` bound to `5`, we get the result `[15, 25, 35]`. These two results, in order, are the elements that make up the sequence which is the result of the outermost `map` expression.
+Why? Because the `filter` expression at the end is restricting the domain that `y` ranges over to `[4, 5]`. Over this domain we are selecting a value to bind `y` to, and then evaluating the `map` expression inside `f` with `y` so bound. With `y` bound to `4`, we get the result `[14, 24, 34]`. With `y` bound to `5`, we get the result `[15, 25, 35]`. These two results, in order, are the elements that make up the sequence which is the result of the outermost `map` expression.
 
 One final twist is that our original list comprehension gives us a "flatter" result. In both Kapulet (and Haskell, modulo a few syntax adjustments), the list comprehension:
 
 
 One final twist is that our original list comprehension gives us a "flatter" result. In both Kapulet (and Haskell, modulo a few syntax adjustments), the list comprehension: