on master help sign in
Merge pull request #4188 from jfdm/fix-docs
f863dd2Jan de Muijnck-Hughes
docs/faq/faq.rst+5−4
@@ -137,7 +137,7 @@ of ``append``, rather than making the type of ``append`` equivalent to...
137
137
138...which is probably not what was intended! The reason for this rule is so
138...which is probably not what was intended! The reason for this rule is so
139that it is clear just from looking at the type of ``append``, and no other
139that it is clear just from looking at the type of ``append``, and no other
140−context, what the implicitly bound names are.
140+context, what the implicitly bound names are.
141
141
142If you want to use an unapplied name in a type, you have two options. You
142If you want to use an unapplied name in a type, you have two options. You
143can either explicitly qualify it, for example, if ``ty`` is defined in the
143can either explicitly qualify it, for example, if ``ty`` is defined in the
@@ -149,7 +149,7 @@ namespace ``Main`` you can do the following:
149
149
150Alternatively, you can use a name which does not begin with a lower case
150Alternatively, you can use a name which does not begin with a lower case
151letter, which will never be implicitly bound:
151letter, which will never be implicitly bound:
152−
152+
153.. code-block:: idris
153.. code-block:: idris
154
154
155 Ty : Type
155 Ty : Type
@@ -283,8 +283,9 @@ This answer is based on Edwin Brady's response in the following
283`pull request <https://github.com/idris-lang/Idris-dev/pull/694#issuecomment-29559291>`__.
283`pull request <https://github.com/idris-lang/Idris-dev/pull/694#issuecomment-29559291>`__.
284
284
285Where can I find the community standards for the Idris community?
285Where can I find the community standards for the Idris community?
286−=======================================
286+==================================================================
287+
287−The Idris Community Standards are stated `here
288+The Idris Community Standards are stated `here
288<https://www.idris-lang.org/documentation/community-standards/>`_ .
289<https://www.idris-lang.org/documentation/community-standards/>`_ .
289
290
290Where can I find more answers?
291Where can I find more answers?
docs/faq/index.rstdeleted−19
@@ -1,19 +0,0 @@
1−.. _faq-index:
2−
3−##########################
4−Frequently Asked Questions
5−##########################
6−
7−.. note::
8− The documentation for Idris has been published under the Creative
9− Commons CC0 License. As such to the extent possible under law, *The
10− Idris Community* has waived all copyright and related or neighboring
11− rights to Documentation for Idris.
12−
13− More information concerning the CC0 can be found online at: http://creativecommons.org/publicdomain/zero/1.0/
14−
15−
16−.. toctree::
17− :maxdepth: 1
18−
19− faq
docs/listing/idris-prompt-helloworld.txt+1−1
@@ -1,7 +1,7 @@
1$ idris hello.idr
1$ idris hello.idr
2 ____ __ _
2 ____ __ _
3 / _/___/ /____(_)____
3 / _/___/ /____(_)____
4− / // __ / ___/ / ___/ Version 1.0
4+ / // __ / ___/ / ___/ Version 1.1.1
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
6 /___/\__,_/_/ /_/____/ Type :? for help
6 /___/\__,_/_/ /_/____/ Type :? for help
7
7
docs/listing/idris-prompt-interp.txt+1−1
@@ -1,7 +1,7 @@
1$ idris interp.idr
1$ idris interp.idr
2 ____ __ _
2 ____ __ _
3 / _/___/ /____(_)____
3 / _/___/ /____(_)____
4− / // __ / ___/ / ___/ Version 1.0
4+ / // __ / ___/ / ___/ Version 1.1.1
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
6 /___/\__,_/_/ /_/____/ Type :? for help
6 /___/\__,_/_/ /_/____/ Type :? for help
7
7
docs/listing/idris-prompt-start.txt+1−1
@@ -1,7 +1,7 @@
1$ idris
1$ idris
2 ____ __ _
2 ____ __ _
3 / _/___/ /____(_)____
3 / _/___/ /____(_)____
4− / // __ / ___/ / ___/ Version 1.0
4+ / // __ / ___/ / ___/ Version 1.1.1
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
5 _/ // /_/ / / / (__ ) http://www.idris-lang.org/
6/___/\__,_/_/ /_/____/ Type :? for help
6/___/\__,_/_/ /_/____/ Type :? for help
7
7
docs/proofs/inductive.rst+2
@@ -1,3 +1,5 @@
1+.. _sect-inductive:
2+
1****************
3****************
2Inductive Proofs
4Inductive Proofs
3****************
5****************
docs/st/state.rst+15−17
@@ -19,10 +19,10 @@ how those resources change when a function runs:
19 Type
19 Type
20
20
21A value of type ``STrans m resultType in_res out_res_fn`` represents a sequence
21A value of type ``STrans m resultType in_res out_res_fn`` represents a sequence
22−of actions which can manipulate state. The arguments are:
22+of actions which can manipulate state. The arguments are:
23
23
24* ``m``, which is an underlying *computation context* in which the actions will be executed.
24* ``m``, which is an underlying *computation context* in which the actions will be executed.
25− Usually, this will be a generic type with a ``Monad`` implementation, but
25+ Usually, this will be a generic type with a ``Monad`` implementation, but
26 it isn't necessarily so. In particular, there is no need to understand monads
26 it isn't necessarily so. In particular, there is no need to understand monads
27 to be able to use ``ST`` effectively!
27 to be able to use ``ST`` effectively!
28* ``resultType``, which is the type of the value the sequence will produce
28* ``resultType``, which is the type of the value the sequence will produce
@@ -76,10 +76,10 @@ resource is still a ``State Integer`` on output:
76 same. We'll introduce a much more concise way of writing this type at the
76 same. We'll introduce a much more concise way of writing this type at the
77 end of this section (:ref:`sttype`), when we describe the ``ST`` type
77 end of this section (:ref:`sttype`), when we describe the ``ST`` type
78 itself.
78 itself.
79−
79+
80This function reads the value stored at the resource ``x`` with ``read``,
80This function reads the value stored at the resource ``x`` with ``read``,
81increments it then writes the result back into the resource ``x`` with
81increments it then writes the result back into the resource ``x`` with
82−``write``. We'll see the types of ``read`` and ``write`` shortly
82+``write``. We'll see the types of ``read`` and ``write`` shortly
83(see :ref:`stransprimops`). We can also create and delete resources:
83(see :ref:`stransprimops`). We can also create and delete resources:
84
84
85.. code-block:: idris
85.. code-block:: idris
@@ -104,7 +104,7 @@ can run it in *any* context. We can run it in the identity context with
104``runPure``. For example, try entering the above definitions in a file
104``runPure``. For example, try entering the above definitions in a file
105``Intro.idr`` then running the following at the REPL:
105``Intro.idr`` then running the following at the REPL:
106
106
107−.. code::
107+.. code::
108
108
109 *Intro> runPure (makeAndIncrement 93)
109 *Intro> runPure (makeAndIncrement 93)
110 94 : Integer
110 94 : Integer
@@ -179,7 +179,7 @@ of ``lift`` shortly.
179 Conceptually, at least, you can think of it as having the following type:
179 Conceptually, at least, you can think of it as having the following type:
180
180
181 .. code-block:: idris
181 .. code-block:: idris
182−
182+
183 (!) : STrans m a state_in state_out -> a
183 (!) : STrans m a state_in state_out -> a
184
184
185 It is syntactic sugar for binding a variable immediately before the
185 It is syntactic sugar for binding a variable immediately before the
@@ -243,7 +243,7 @@ context. Here, we use ``run``, which allows us to execute an ``STrans`` program
243in any context (as long as it has an implementation of ``Applicative``) and we
243in any context (as long as it has an implementation of ``Applicative``) and we
244can execute ``ioMakeAndIncrement`` at the REPL as follows:
244can execute ``ioMakeAndIncrement`` at the REPL as follows:
245
245
246−.. code::
246+.. code::
247
247
248 *Intro> :exec run ioMakeAndIncrement
248 *Intro> :exec run ioMakeAndIncrement
249 Enter a number: 93
249 Enter a number: 93
@@ -269,7 +269,7 @@ its length will change:
269 addElement vec item = do xs <- read vec
269 addElement vec item = do xs <- read vec
270 write vec (item :: xs)
270 write vec (item :: xs)
271
271
272−Note that you'll need to ``import Data.Vect`` to try this example.
272+Note that you'll need to ``import Data.Vect`` to try this example.
273
273
274.. topic:: Updating a state directly with ``update``
274.. topic:: Updating a state directly with ``update``
275
275
@@ -344,7 +344,7 @@ if the input is valid. We can express this in the type as follows:
344Then, when we implement ``readAndAdd`` we need to return the appropriate
344Then, when we implement ``readAndAdd`` we need to return the appropriate
345value for the output state. If we've added an item to the vector, we need to
345value for the output state. If we've added an item to the vector, we need to
346return ``True``, otherwise we need to return ``False``:
346return ``True``, otherwise we need to return ``False``:
347−
347+
348.. code-block:: idris
348.. code-block:: idris
349
349
350 readAndAdd : ConsoleIO io => (vec : Var) ->
350 readAndAdd : ConsoleIO io => (vec : Var) ->
@@ -435,7 +435,7 @@ we can do as follows:
435
435
436.. _stransprimops:
436.. _stransprimops:
437
437
438−``STrans`` Primitive operations
438+``STrans`` Primitive operations
439===============================
439===============================
440
440
441Now that we've written a few small examples of ``STrans`` functions, it's
441Now that we've written a few small examples of ``STrans`` functions, it's
@@ -485,7 +485,7 @@ of type ``State state``:
485
485
486.. code-block:: idris
486.. code-block:: idris
487
487
488− new : (val : state) ->
488+ new : (val : state) ->
489 STrans m Var res (\lbl => (lbl ::: State state) :: res)
489 STrans m Var res (\lbl => (lbl ::: State state) :: res)
490
490
491It's important that the new resource has type ``State state``, rather than
491It's important that the new resource has type ``State state``, rather than
@@ -526,7 +526,7 @@ the resource list so that it is appropriate for returning that value:
526
526
527.. code-block:: idris
527.. code-block:: idris
528
528
529− returning : (result : ty) ->
529+ returning : (result : ty) ->
530 STrans m () res (const (out_fn result)) ->
530 STrans m () res (const (out_fn result)) ->
531 STrans m ty res out_fn
531 STrans m ty res out_fn
532
532
@@ -555,7 +555,7 @@ programming and reasoning in Idris.
555.. _sttype:
555.. _sttype:
556
556
557`ST`: Representing state transitions directly
557`ST`: Representing state transitions directly
558−============================================
558+=============================================
559
559
560We've seen a few examples of small ``STrans`` functions now, and
560We've seen a few examples of small ``STrans`` functions now, and
561their types can become quite verbose given that we need to provide explicit
561their types can become quite verbose given that we need to provide explicit
@@ -568,7 +568,7 @@ giving input and output resource lists in full. We can do this with
568.. code-block:: idris
568.. code-block:: idris
569
569
570 ST : (m : Type -> Type) ->
570 ST : (m : Type -> Type) ->
571− (resultType : Type) ->
571+ (resultType : Type) ->
572 List (Action resultType) -> Type
572 List (Action resultType) -> Type
573
573
574``ST`` is a type level function which computes an appropriate ``STrans``
574``ST`` is a type level function which computes an appropriate ``STrans``
@@ -593,7 +593,7 @@ So, we can write some of the function types we've seen so far as follows:
593That is, ``increment`` begins and ends with ``x`` in state ``State Integer``.
593That is, ``increment`` begins and ends with ``x`` in state ``State Integer``.
594
594
595.. code-block:: idris
595.. code-block:: idris
596−
596+
597 makeAndIncrement : Int -> ST m Int []
597 makeAndIncrement : Int -> ST m Int []
598
598
599That is, ``makeAndIncrement`` begins and ends with no resources.
599That is, ``makeAndIncrement`` begins and ends with no resources.
@@ -652,5 +652,3 @@ the rare occasions we need the full precision of ``STrans``. In the next
652section, we'll see how to use the facilities provided by ``ST`` to write
652section, we'll see how to use the facilities provided by ``ST`` to write
653a precise API for a system with security properties: a data store requiring
653a precise API for a system with security properties: a data store requiring
654a login.
654a login.
655−
656−
docs/tutorial/index.rst+2−1
@@ -4,7 +4,7 @@
4The Idris Tutorial
4The Idris Tutorial
5##################
5##################
6
6
7−This is the Idris Tutorial.
7+This is the Idris Tutorial.
8It provides a brief introduction to programming in the Idris Language.
8It provides a brief introduction to programming in the Idris Language.
9It covers the core language features, and assumes some familiarity with an
9It covers the core language features, and assumes some familiarity with an
10existing functional programming language such as Haskell or OCaml.
10existing functional programming language such as Haskell or OCaml.
@@ -30,6 +30,7 @@ existing functional programming language such as Haskell or OCaml.
30 interp
30 interp
31 views
31 views
32 theorems
32 theorems
33+ provisional
33 interactive
34 interactive
34 syntax
35 syntax
35 miscellany
36 miscellany
docs/tutorial/interfaces.rst+6−6
@@ -48,7 +48,7 @@ For example, the
48Only one implementation of an interface can be given for a type — implementations may
48Only one implementation of an interface can be given for a type — implementations may
49not overlap. Implementation declarations can themselves have constraints.
49not overlap. Implementation declarations can themselves have constraints.
50To help with resolution, the arguments of an implementation must be
50To help with resolution, the arguments of an implementation must be
51−constructors (either data or type constructors) or variables
51+constructors (either data or type constructors) or variables
52(i.e. you cannot give an implementation for a function). For
52(i.e. you cannot give an implementation for a function). For
53example, to define a ``Show`` implementation for vectors, we need to know
53example, to define a ``Show`` implementation for vectors, we need to know
54that there is a ``Show`` implementation for the element type, because we are
54that there is a ``Show`` implementation for the element type, because we are
@@ -157,7 +157,7 @@ Note: Interfaces and ``mutual`` blocks
157~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158
158
159Idris is strictly "define before use", except in ``mutual`` blocks.
159Idris is strictly "define before use", except in ``mutual`` blocks.
160−In a ``mutual`` block, Idris elaborates in two passes: types on the first
160+In a ``mutual`` block, Idris elaborates in two passes: types on the first
161pass and definitions on the second. When the mutual block contains an
161pass and definitions on the second. When the mutual block contains an
162interface declaration, it elaborates the interface header but none of the
162interface declaration, it elaborates the interface header but none of the
163method types on the first pass, and elaborates the method types and any
163method types on the first pass, and elaborates the method types and any
@@ -259,7 +259,7 @@ are both available, or return ``Nothing`` if one or both are not ("fail fast").
259 Nothing : Maybe Int
259 Nothing : Maybe Int
260
260
261Pattern Matching Bind
261Pattern Matching Bind
262−---------------------
262+~~~~~~~~~~~~~~~~~~~~~
263
263
264Sometimes we want to pattern match immediately on the result of a function
264Sometimes we want to pattern match immediately on the result of a function
265in ``do`` notation. For example, let's say we have a function ``readNumber``
265in ``do`` notation. For example, let's say we have a function ``readNumber``
@@ -323,7 +323,7 @@ of the ``do`` block. The second part gives the alternative bindings, of which
323there may be more than one.
323there may be more than one.
324
324
325``!``-notation
325``!``-notation
326−--------------
326+~~~~~~~~~~~~~~
327
327
328In many cases, using ``do``-notation can make programs unnecessarily
328In many cases, using ``do``-notation can make programs unnecessarily
329verbose, particularly in cases such as ``m_add`` above where the value
329verbose, particularly in cases such as ``m_add`` above where the value
@@ -367,7 +367,7 @@ is lifted to:
367 f g'
367 f g'
368
368
369Monad comprehensions
369Monad comprehensions
370−--------------------
370+~~~~~~~~~~~~~~~~~~~~
371
371
372The list comprehension notation we saw in Section
372The list comprehension notation we saw in Section
373:ref:`sect-more-expr` is more general, and applies to anything which
373:ref:`sect-more-expr` is more general, and applies to anything which
@@ -461,7 +461,7 @@ application ``[| f a1 …an |]`` is translated into ``pure f <*> a1 <*>
461 m_add' x y = [| x + y |]
461 m_add' x y = [| x + y |]
462
462
463An error-handling interpreter
463An error-handling interpreter
464−-----------------------------
464+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
465
465
466Idiom notation is commonly useful when defining evaluators. McBride
466Idiom notation is commonly useful when defining evaluators. McBride
467and Paterson describe such an evaluator [1]_, for a language similar
467and Paterson describe such an evaluator [1]_, for a language similar
docs/tutorial/modules.rst−4
@@ -189,8 +189,6 @@ the ``public`` modifier on an ``import``. For example:
189 import B
189 import B
190 import public C
190 import public C
191
191
192− public a : AType a = ...
193−
194The module ``A`` will export the name ``a``, as well as any public or
192The module ``A`` will export the name ``a``, as well as any public or
195abstract names in module ``C``, but will not re-export anything from
193abstract names in module ``C``, but will not re-export anything from
196module ``B``.
194module ``B``.
@@ -277,5 +275,3 @@ which can be inferred by the type checker:
277
275
278 *params> show (append _ _ (MkVects _ [1,2,3] [4,5,6]))
276 *params> show (append _ _ (MkVects _ [1,2,3] [4,5,6]))
279 "[1, 2, 3, 4, 5, 6]" : String
277 "[1, 2, 3, 4, 5, 6]" : String
280−
281−
docs/tutorial/starting.rst+1−1
@@ -11,7 +11,7 @@ Before installing Idris, you will need to make sure you have all
11of the necessary libraries and tools. You will need:
11of the necessary libraries and tools. You will need:
12
12
13- A fairly recent version of `GHC <https://www.haskell.org/ghc/>`_. The
13- A fairly recent version of `GHC <https://www.haskell.org/ghc/>`_. The
14− earliest version we currently test with is 7.6.3.
14+ earliest version we currently test with is 7.10.3.
15
15
16- The *GNU Multiple Precision Arithmetic Library* (GMP) is available from MacPorts/Homebrew and all major Linux distributions.
16- The *GNU Multiple Precision Arithmetic Library* (GMP) is available from MacPorts/Homebrew and all major Linux distributions.
17
17
idris-tutorial.pdf

Binary file not shown.