@@ -575,6 +575,7 @@ data Vect : Set -> Nat -> Set where
575575\end{SaveVerbatim}
576576\useverb{listvec}
577577
578+\noindent
578579Note that the constructor names are the same for each --- constructor names (in
579580fact, names in general) can be overloaded, provided that they are declared in
580581different namespaces (see Section \ref{sect:namespaces}), and will typically be
@@ -586,6 +587,7 @@ names \texttt{Nil} and \texttt{::} can be written in list form. For example:
586587\item \texttt{[1,2,3]} means \texttt{Cons 1 (Cons 2 (Cons 3 Nil))}
587588\end{itemize}
588589
590+\noindent
589591The library also defines a number of functions for manipulating these types.
590592\texttt{map} is overloaded both for \texttt{List} and \texttt{Vect}
591593and applies a function to every element of the list or vector.
@@ -628,6 +630,7 @@ You'll find these examples in \texttt{usefultypes.idr} in the \texttt{examples/}
628630\end{SaveVerbatim}
629631\useverb{rundvect}
630632
633+\noindent
631634For more details of the functions available on \texttt{List} and \texttt{Vect},
632635look in the library, in \texttt{prelude/list.idr} and \texttt{prelude/vect.idr} respectively.
633636Functions include filtering, appending, reversing, and so on. Also remember
@@ -681,6 +684,7 @@ data Maybe a = Just a | Nothing;
681684\end{SaveVerbatim}
682685\useverb{maybe}
683686
687+\noindent
684688\texttt{Maybe} is one way of giving a type to an operation that may fail. For example,
685689looking something up in a \texttt{List} (rather than a vector) may result in an out of
686690bounds error:
@@ -695,6 +699,7 @@ list_lookup (S k) (x :: xs) = list_lookup k xs;
695699\end{SaveVerbatim}
696700\useverb{lookuplist}
697701
702+\noindent
698703The \texttt{maybe} function is used to process values of type \texttt{Maybe},
699704either by applying a function to the value, if there is one, or by providing a default value:
700705
@@ -705,6 +710,7 @@ maybe : Maybe a -> |(default:b) -> (a -> b) -> b;
705710\end{SaveVerbatim}
706711\useverb{maybefn}
707712
713+\noindent
708714The vertical bar $\mid$ before the default value is a laziness annotation. Normally
709715expressions are evaluated before being passed to a function. This is typically
710716the most efficient behaviour. However, in this case, the default value might
@@ -723,6 +729,7 @@ data Pair a b = MkPair a b;
723729\end{SaveVerbatim}
724730\useverb{mkpair}
725731
732+\noindent
726733As syntactic sugar, we can write \texttt{(a, b)} which, according to context,
727734means either \texttt{Pair a b} or \texttt{MkPair a b}.
728735Tuples can contain an arbitrary number of values, represented as nested pairs:
@@ -751,6 +758,7 @@ data Exists : (A : Set) -> (P : A -> Set) -> Set where
751758\end{SaveVerbatim}
752759\useverb{sigma}
753760
761+\noindent
754762Again, there is syntactic sugar for this. \texttt{(a : A ** P)} is the type of a pair of
755763A and P, where the name \texttt{a} can occur inside P. \texttt{( a ** p (}
756764constructs a value of this type. For example, we can pair a number with a
@@ -790,6 +798,7 @@ vec = (_ ** [3, 4]);
790798\end{SaveVerbatim}
791799\useverb{dvec2}
792800
801+\noindent
793802One use for dependent pairs is to return values of dependent types where the
794803index is not necessarily known in advance. For example, if we filter elements
795804out of a \texttt{Vect} according to some predicate, we will not know in advance what the
@@ -812,6 +821,7 @@ vfilter p VNil = (_ , []);
812821\end{SaveVerbatim}
813822\useverb{vfilternil}
814823
824+\noindent
815825In the \texttt{::} case, we need to inspect the result of a recursive call to
816826\texttt{filter} to
817827extract the length and the vector from the result. To do this, we use \texttt{with}