Table alignment in functional/index.md (#152)

* Right align table in plain text version
  Makes the plain text version easier to read

* Center alignment in mdbook/md
pull/154/head
Ivan Tham 3 years ago committed by GitHub
parent 7ac0b4f79d
commit 448af714a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,7 +15,7 @@ println!("{}", sum);
With imperative programs, we have to play compiler to see what is happening. Here, we start with a `sum` of `0`. Next, we iterate through the range from 1 to 10. Each time through the loop, we add the corresponding value in the range. Then we print it out.
| `i` | `sum` |
| --- | ----- |
|:---:|:-----:|
| 1 | 1 |
| 2 | 3 |
| 3 | 6 |
@ -40,7 +40,7 @@ Whoa! This is really different! What's going on here? Remember that with declara
Here, we are composing functions of addition (this closure: `|a, b| a + b)`) with a range from 1 to 10. The `0` is the starting point, so `a` is `0` at first. `b` is the first element of the range, `1`. `0 + 1 = 1` is the result. So now we `fold` again, with `a = 1`, `b = 2` and so `1 + 2 = 3` is the next result. This process continues until we get to the last element in the range, `10`.
| `a` | `b` | result |
| --- | --- | ------ |
|:---:|:---:|:------:|
| 0 | 1 | 1 |
| 1 | 2 | 3 |
| 3 | 3 | 6 |

Loading…
Cancel
Save