@@ -172,3 +172,59 @@ types:
172\end{SaveVerbatim}
172\end{SaveVerbatim}
173\useverb{usetest}
173\useverb{usetest}
175+\subsection{Parameterised blocks}
177+Groups of functions can be parameterised over a number of arguments using a
178+\texttt{parameters} declaration, for example:
180+\begin{SaveVerbatim}{paramex}
182+parameters (x : Nat, y : Nat)
184+ addAll z = x + y + z
190+The effect of a \texttt{parameters} block is to add the declared parameters to every
191+function, type and data constructor within the block. Outside the block, the parameters
192+must be given explicitly:
194+\begin{SaveVerbatim}{addall}
197+addAll : Nat -> Nat -> Nat -> Nat
203+Parameters blocks can be nested, and can also include data declarations, in
204+which case the parameters are added explicitly to all type and data
205+constructors. They may also be dependent types with implicit arguments:
207+\begin{SaveVerbatim}{paramdata}
209+parameters (xs : Vect a x, y : Nat)
210+ data Vects : Set -> Set where
211+ MkVects : Vect a y -> Vects a
213+ append : Vects a -> Vect a (x + y)
214+ append (MkVects ys) = xs ++ ys
220+To use \texttt{Vects} or \texttt{append} outside the block, we must also
221+give the \texttt{xs} and \texttt{y} arguments. Here, we can use placeholders for
222+the values which can be inferred by the type checker:
224+\begin{SaveVerbatim}{paramuse}
226+*params> show (append _ _ (MkVects [1,2,3] _ [4,5,6]))
227+"[1, 2, 3, 4, 5, 6]" : String