Skip to content

Commit cfa1508

Browse files
committed
Use todonotes package
https://ctan.org/pkg/todonotes
1 parent a2b88d8 commit cfa1508

File tree

2 files changed

+22
-33
lines changed

2 files changed

+22
-33
lines changed

src/Basics.lidr

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ that can be used to prove simple properties of Idris programs.
5656

5757
== Enumerated Types
5858

59-
\color{red}
60-
-- TODO: Edit the following.
59+
\todo[inline]{Edit the following.}
6160

6261
One unusual aspect of Coq is that its set of built-in features is _extremely_
6362
small, For example, instead of providing the usual palette of atomic data types
@@ -165,9 +164,7 @@ First, we can evaluate an expression involving `nextWeekday` in a REPL.
165164
-- Tuesday : Day
166165
```
167166

168-
\color{red}
169-
-- TODO: Mention other editors? Discuss idris-mode?
170-
\color{black}
167+
\todo[inline]{Mention other editors? Discuss idris-mode?}
171168

172169
We show Idris's responses in comments, but, if you have a computer handy, this
173170
would be an excellent moment to fire up the Idris interpreter under your
@@ -190,8 +187,7 @@ Having made the assertion, we can also ask Idris to verify it, like this:
190187

191188
> testNextWeekday = Refl
192189

193-
\color{red}
194-
-- TODO: Edit this
190+
\todo[inline]{Edit this}
195191

196192
The details are not important for now (we'll come back to them in a bit), but
197193
essentially this can be read as "The assertion we've just made can be proved by
@@ -205,8 +201,7 @@ point on the name (`testNextWeekday`) in the type signature and then call
205201
\mintinline[]{elisp}{idris-proof-search} (\mintinline[]{elisp}{M-RET p}) with
206202
the point on the resultant hole to have Idris solve the proof for you.)
207203

208-
\color{red}
209-
-- TODO: verify the "main uses" claim.
204+
\todo[inline]{Verify the "main uses" claim.}
210205

211206
Third, we can ask Idris to _generate_, from our definition, a program in some
212207
other, more conventional, programming (C, Javascript and Node are bundled with
@@ -278,8 +273,7 @@ truth table -- for the `orb` function:
278273
> testOrb4 : (orb True True) = True
279274
> testOrb4 = Refl
280275

281-
\color{red}
282-
-- TODO: Edit this
276+
\todo[inline]{Edit this.}
283277

284278
We can also introduce some familiar syntax for the boolean operations we have
285279
just defined. The `syntax` command defines a new symbolic notation for an
@@ -362,8 +356,7 @@ For example, the type of `negb True` is `Bool`.
362356
-- negb True : Bool
363357
```
364358

365-
\color{red}
366-
-- TODO: Confirm the "function types" wording.
359+
\todo[inline]{Confirm the "function types" wording.}
367360

368361
Functions like `negb` itself are also data values, just like `True` and `False`.
369362
Their types are called _function types_, and they are written with arrows.
@@ -383,8 +376,7 @@ output of type `Bool`."
383376

384377
== Modules
385378

386-
\color{red}
387-
-- TODO: Flesh this out and discuss namespaces
379+
\todo[inline]{Flesh this out and discuss namespaces}
388380

389381
Idris provides a _module system_, to aid in organizing large developments.
390382
\color{black}
@@ -551,8 +543,7 @@ minus n Z = n
551543
minus (S k) (S j) = minus k j
552544
```
553545

554-
\color{red}
555-
-- TODO: Verify this.
546+
\todo[inline]{Verify this.}
556547

557548
The `_` in the first line is a _wilcard pattern_. Writing `_` in a pattern is
558549
the same as writing some variable that doesn't get used on the right-hand side.
@@ -775,9 +766,13 @@ will be useful for making some larger argument, use holes to delay defining them
775766
for the moment, and continue working on the main argument until we are sure it
776767
makes sense; then we can go back and fill in the proofs we skipped.
777768

778-
> -- TODO: Decide whether or not to discuss `postulate`.
779-
> -- Be careful, though: every time you say `postulate` you are leaving a door open
780-
> -- for total nonsense to enter Idris's nice, rigorous, formally checked world!
769+
\todo[inline]{
770+
Decide whether or not to discuss `postulate`.
771+
```idris
772+
-- Be careful, though: every time you say `postulate` you are leaving a door open
773+
-- for total nonsense to enter Idris's nice, rigorous, formally checked world!
774+
```
775+
}
781776

782777
We can also use the `rewrite` tactic with a previously proved theorem instead of
783778
a hypothesis from the context. If the statement of the previously proved theorem
@@ -827,9 +822,7 @@ that, again, `beq_nat (n + 1) 0` will yield `False`.
827822
To tell Idris to consider, separately, the cases where `n = Z` and
828823
where `n = S k`, simply case split on `n`.
829824

830-
\color{red}
831-
-- TODO: mention case splitting interactively in Emacs, Atom, etc.
832-
\color{black}
825+
\todo[inline]{Mention case splitting interactively in Emacs, Atom, etc.}
833826

834827
> plus_1_neq_0 : (n : Nat) -> beq_nat (n + 1) 0 = False
835828
> plus_1_neq_0 Z = Refl
@@ -910,9 +903,7 @@ $\square$
910903
$\square$
911904

912905

913-
\color{red}
914-
-- TODO: discuss associativity
915-
\color{black}
906+
\todo[inline]{Discuss associativity.}
916907

917908

918909
== Structural Recursion (Optional)
@@ -938,13 +929,9 @@ all inputs. However, because Idris's "decreasing analysis" is not very
938929
sophisticated, it is sometimes necessary to write functions in slightly
939930
unnatural ways.
940931

941-
\color{red}
942-
-- TODO: verify the previous claims
943-
\color{black}
932+
\todo[inline]{Verify the previous claims.}
944933

945-
\color{red}
946-
-- TODO: Add decreasing exercise
947-
\color{black}
934+
\todo[inline]{Add decreasing exercise.}
948935

949936

950937
== More Exercises

src/book.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
classoption: twoside
2424
papersize: b5
2525
geometry: margin=1in
26-
header-includes: \usepackage{minted}
26+
header-includes:
27+
- \usepackage{minted}
28+
- \usepackage{todonotes}
2729
include-before: \frontmatter
2830
---
2931

0 commit comments

Comments
 (0)