Skip to content

Commit f6da3c2

Browse files
committed
reviewer suggestions
1 parent 1e09c0b commit f6da3c2

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

tex/chProgramming.tex

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -889,11 +889,10 @@ \subsection{Natural numbers}\index[concept]{natural number}
889889
\end{coq}
890890
\coqrun{name=larger_than4_run}{ssr,larger_than4}
891891

892-
On the other hand, if we want to describe a different computation for
893-
three different cases and use variables in more than one case, we
894-
must either awkwardly nest several ``\C{if .. then .. else}'' blocks
895-
inside each other, or (better) use the more general
896-
``\C{match .. with .. end}'' syntax. Here is an example:
892+
The ``\C{if .. then .. else}'' syntax is just a particular case
893+
of the more general ``\C{match .. with .. end}'' construct,
894+
which allows us to separate several (not just two) cases.
895+
Here is an example:
897896

898897
\begin{coq}{name=awkward5}{}
899898
Definition three_patterns n :=
@@ -977,7 +976,7 @@ \subsection{Natural numbers}\index[concept]{natural number}
977976
Definition same_bool b1 b2 :=
978977
match b1 with
979978
| true => match b2 with true => true | _ => false end
980-
| false => match b2 with false => true | _ => false end
979+
| false => match b2 with true => false | _ => true end
981980
end.
982981
\end{coq}
983982
\coqrun{name=awk7_run}{ssr,awkward7}
@@ -1321,7 +1320,7 @@ \section{Containers}\label{sec:poly}
13211320

13221321
As expected, \C{listn} %elements of this data type
13231322
cannot hold boolean values.
1324-
So, if we need to manipulate a list of booleans,
1323+
So if we need to manipulate a list of booleans
13251324
we have to define a similar data type:
13261325
\C{listb}.
13271326

@@ -1386,7 +1385,7 @@ \subsection{The (polymorphic) sequence data type}
13861385

13871386

13881387
The name \C{seq} refers to (finite) ``sequences'', also called
1389-
``lists''. This definition describes the type
1388+
``lists''. This definition actually describes the type
13901389
of lists as a {\em polymorphic type}. This means that there is a
13911390
different type \C{(seq A)} for each possible choice of type \C{A}. For example
13921391
\C{(seq nat)} is the type of sequences of natural numbers, while

0 commit comments

Comments
 (0)