@@ -23,12 +23,13 @@ file, or a .o file from a .c file. There are at least two ways to do it:
23
23
24
24
Open `Basics . lidr`. Evaluate `idris- load- file`.
25
25
26
- There exists similar support for [Vim ][idris- vim] and [Sublime
27
- Text ][idris- sublime] as well.
26
+ There exists similar support for [Vim ][idris- vim], [Sublime
27
+ Text ][idris- sublime] and [ Visual Studio Code ][idris - vscode] as well.
28
28
29
29
[idris- mode]: https : //github.com/idris-hackers/idris-mode
30
30
[idris- vim]: https : //github.com/idris-hackers/idris-vim
31
31
[idris- sublime]: https : //github.com/idris-hackers/idris-sublime
32
+ [idris- vscode]: https : //github.com/zjhmale/vscode-idris
32
33
33
34
- From the command line :
34
35
@@ -40,7 +41,7 @@ file, or a .o file from a .c file. There are at least two ways to do it:
40
41
41
42
== Proof by Induction
42
43
43
- We proved in the last chapter that `0` is a netural element for `+ ` on the left
44
+ We proved in the last chapter that `0` is a neutral element for `+ ` on the left
44
45
using an easy argument based on simplification. The fact that it is also a
45
46
neutral element on the _right_...
46
47
@@ -120,7 +121,7 @@ $\square$
120
121
121
122
=== Exercise : 2 stars, optional (evenb_S)
122
123
123
- One inconveninent aspect of our definition of `evenb n` is that it may need to
124
+ One inconvenient aspect of our definition of `evenb n` is that it may need to
124
125
perform a recursive call on `n - 2 `. This makes proofs about `evenb n` harder
125
126
when done by induction on `n` , since we may need an induction hypothesis about
126
127
`n - 2 `. The following lemma gives a better characterization of `evenb (S n)`:
@@ -181,17 +182,16 @@ _ does not have an equality type ((n1 : Nat) ->
181
182
```
182
183
183
184
To get `plus_comm` to apply at the point where we want it to , we can introduce a
184
- local lemma stating that `n + m = m + n` (for the particular `m` and `n` that we
185
- are talking about here ), prove this lemma using `plus_comm`, and then use it to
186
- do the desired rewrite .
187
-
188
- > plus_rearrange_lemma : (n, m : Nat) -> n + m = m + n
189
- > plus_rearrange_lemma = plus_comm
185
+ local lemma using the `where` keyword stating that `n + m = m + n` (for the
186
+ particular `m` and `n` that we are talking about here ), prove this lemma using
187
+ `plus_comm`, and then use it to do the desired rewrite.
190
188
191
189
> plus_rearrange : (n, m, p, q : Nat) ->
192
190
> (n + m) + (p + q) = (m + n) + (p + q)
193
191
> plus_rearrange n m p q = rewrite plus_rearrange_lemma n m in Refl
194
-
192
+ > where
193
+ > plus_rearrange_lemma : (n, m : Nat) -> n + m = m + n
194
+ > plus_rearrange_lemma = plus_comm
195
195
196
196
== More Exercises
197
197
0 commit comments