on master help sign in
Fixes #2035 Documenting Parameterised Blocks.

The documentation for Parameter blocks in the tutorial did not explicitly mention where the arguments were added to the affected definitions. This commit adds further detail to the explanation.

commit667d6e01d81bdcee487df353ece782f8a08c042a authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateFri 11 Dec 2015, 10:25 (11 years ago) parente66ede2
1 file changed+12−2
docs/tutorial/modules.rst+12−2
docs/tutorial/modules.rst+12−2
@@ -212,14 +212,24 @@ using a ``parameters`` declaration, for example:
212212 addAll z = x + y + z
213213
214214The effect of a ``parameters`` block is to add the declared parameters
215−to every function, type and data constructor within the block. Outside
216−the block, the parameters must be given explicitly:
215+to every function, type and data constructor within the
216+block. Specifically, adding the parameters to the front of the
217+argument list. Outside the block, the parameters must be given
218+explicitly. The ``addAll`` function, when called from the REPL, will
219+thus have the following type signature.
217220
218221::
219222
220223 *params> :t addAll
221224 addAll : Nat -> Nat -> Nat -> Nat
222225
226+and the following definition.
227+
228+.. code-block:: idris
229+
230+ addAll : (x : Nat) -> (y : Nat) -> (z : Nat) -> Nat
231+ addAll x y z = x + y + z
232+
223233Parameters blocks can be nested, and can also include data declarations,
224234in which case the parameters are added explicitly to all type and data
225235constructors. They may also be dependent types with implicit arguments: