on master help sign in
Fixed the last set (hopefull) of errors from the pandoc conversion.
commit673bb9922ba9b073bac5b7db76b323a2b48e950c authorJan de Muijnck-Hughes <jfdm@st-andrews.ac.uk> dateThu 19 Mar 2015, 19:34 (12 years ago) parentb70f2f1
4 files changed+41−33
docs/effects/impleff.rst+7−6 docs/effects/introduction.rst+26−24 docs/tutorial/classes.rst+4−3 docs/tutorial/typesfuns.rst+4
docs/effects/impleff.rst+7−6
@@ -5,12 +5,13 @@ Creating New Effects
55====================
66
77We have now seen several side-effecting operations provided by the
8−library, and examples of their use in Section :ref:`sect-simpleff`. We have
9−also seen how operations may *modify* the available effects by changing
10−state in Section :ref:`sect-depeff`. We have not, however, yet seen how these
11−operations are implemented. In this section, we describe how a selection
12−of the available effects are implemented, and show how new effectful
13−operations may be provided.
8+``Effects`` library, and examples of their use in Section
9+:ref:`sect-simpleff`. We have also seen how operations may *modify*
10+the available effects by changing state in Section
11+:ref:`sect-depeff`. We have not, however, yet seen how these
12+operations are implemented. In this section, we describe how a
13+selection of the available effects are implemented, and show how new
14+effectful operations may be provided.
1415
1516State
1617-----
docs/effects/introduction.rst+26−24
@@ -14,9 +14,10 @@ supports programming and reasoning with side-effecting programs,
1414supporting mutable state, interaction with the outside world,
1515exceptions, and verified resource management.
1616
17−This tutorial assumes familiarity with pure programming in , as
18−described in Sections 1–6 of the main tutorial [1]_. The examples are
19−tested with version .
17+This tutorial assumes familiarity with pure programming in ``Idris``,
18+as described in Sections 1–6 of the main tutorial [1]_. The examples
19+are presented are tested with ``Idris`` and can be found in the
20+examples directory of the ``Idris`` repository.
2021
2122Consider, for example, the following introductory function which
2223illustrates the kind of properties which can be expressed in the type
@@ -46,16 +47,16 @@ able to apply the ``vadd`` function? Before doing so, we will have to:
4647
4748The complete program will include side-effects for I/O and error
4849handling, before we can get to the pure core functionality. In this
49−tutorial, we will see how supports side-effects. Furthermore, we will
50−see how we can use the dependent type system to *reason* about stateful
51−and side-effecting programs. We will return to this specific example
52−later.
50+tutorial, we will see how ``Idris`` supports side-effects.
51+Furthermore, we will see how we can use the dependent type system to
52+*reason* about stateful and side-effecting programs. We will return to
53+this specific example later.
5354
5455Hello world
5556===========
5657
5758To give an idea of how programs with effects look in , here is the
58−ubiquitous “Hello world” program, written using the library:
59+ubiquitous “Hello world” program, written using the ``Effects`` library:
5960
6061.. code-block:: idris
6162
@@ -74,8 +75,8 @@ the ``hello`` function which supports the ``STDIO`` effect for console
7475I/O, and returns the unit value. The details of the ``Eff`` type will be
7576presented in the remainder of this tutorial.
7677
77−To compile and run this program, needs to be told to include the
78−package, using the ``-p`` flag (this flag is required for all examples
78+To compile and run this program, ``Idris`` needs to be told to include the
79+``Effects`` package, using the ``-p effects`` flag (this flag is required for all examples
7980in this tutorial):
8081
8182.. code-block:: sh
@@ -86,20 +87,21 @@ in this tutorial):
8687Outline
8788=======
8889
89−The tutorial is structured as follows: first, in :ref:`sect-state`,
90−we will discuss state management, describing why it is important and
91−introducing the library to show how it can be used to manage state. This
92−section also gives an overview of the syntax of effectful programs.
93−:ref:`sect-simpleff` then introduces a number of other effects a
94−program may have: I/O; Exceptions; Random Numbers; and Non-determinism,
95−giving examples for each, and an extended example combining several
96−effects in one complete program. :ref:`sect-depeff` introduces
97−*dependent* effects, showing how states and resources can be managed in
98−types. :ref:`sect-impleff` shows how new effects can be implemented.
99−:ref:`sect-hangman` gives an extended example showing how to
100−implement a “mystery word” guessing game, using effects to describe the
101−rules of the game and ensure they are implemented accurately. References
102−to further reading are given in :ref:`sect-further`.
90+The tutorial is structured as follows: first, in :ref:`sect-state`, we
91+will discuss state management, describing why it is important and
92+introducing the ``effects`` library to show how it can be used to
93+manage state. This section also gives an overview of the syntax of
94+effectful programs. :ref:`sect-simpleff` then introduces a number of
95+other effects a program may have: I/O; Exceptions; Random Numbers; and
96+Non-determinism, giving examples for each, and an extended example
97+combining several effects in one complete program. :ref:`sect-depeff`
98+introduces *dependent* effects, showing how states and resources can
99+be managed in types. :ref:`sect-impleff` shows how new effects can be
100+implemented. :ref:`sect-hangman` gives an extended example showing
101+how to implement a “mystery word” guessing game, using effects to
102+describe the rules of the game and ensure they are implemented
103+accurately. References to further reading are given in
104+:ref:`sect-further`.
103105
104106.. [1]
105107 You do not, however, need to know what a monad is. A correctness
docs/tutorial/classes.rst+4−3
@@ -195,8 +195,9 @@ Monads and ``do``-notation
195195--------------------------
196196
197197The ``Monad`` class allows us to encapsulate binding and computation,
198−and is the basis of ``do``-notation introduced in Section [sect:do]. It
199−extends ``Applicative`` as defined above, and is defined as follows:
198+and is the basis of ``do``-notation introduced in Section 
199+:ref:`sect-do`. It extends ``Applicative`` as defined above, and is
200+defined as follows:
200201
201202.. code-block:: idris
202203
@@ -384,7 +385,7 @@ An error-handling interpreter
384385~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
385386
386387Idiom notation is commonly useful when defining evaluators. McBride and
387−Paterson describe such an evaluator [1], for a language similar to the
388+Paterson describe such an evaluator [1]_, for a language similar to the
388389following:
389390
390391.. code-block:: idris
docs/tutorial/typesfuns.rst+4
@@ -518,6 +518,8 @@ for reading and writing files, including:
518518
519519 readFile : String -> IO String
520520
521+.. _sect-do:
522+
521523“``do``” notation
522524-----------------
523525
@@ -825,6 +827,8 @@ intermediate values:
825827
826828We will see more on ``with`` notation later.
827829
830+.. _sect-more-expr:
831+
828832More Expressions
829833----------------
830834