on master help sign in
Some documentation updates
commit5399670dd3c8606c5c176b10401fd7ff304d52af authorEdwin Brady <eb@cs.st-andrews.ac.uk> dateThu 2 Feb 2012, 17:27 (15 years ago) parent709e330
4 files changed+15−7
CHANGELOG+7−1 idris.cabal+1−1 tutorial/classes.tex+7−5 tutorial/idris-tutorial.pdf
CHANGELOG+7−1
@@ -8,11 +8,17 @@ User visible changes:
88* Totality checking and 'total' keyword
99* Auto implicits and default argument values {auto n : T}, {default val n : T}
1010* Additions to prelude, including Nat and List theorems
11−* New libs: control.monad.identity, control.monad.state
11+* Overlapping type class instances disallowed
12+* Many extensions to nat and list libraries (mostly thanks to Dominic
13+ Mulligan)
14+* New libraries: control.monad.identity, control.monad.state
15+* Small improvements in error reporting
1216
1317Internal changes:
1418
1519* Faster compilation (only compiling names which are used)
20+* Better type class resolution
21+* Lots of minor bug fixes
1622
17230.1.x to 0.9.0:
1824
idris.cabal+1−1
@@ -41,7 +41,7 @@ Cabal-Version: >= 1.6
4141Build-type: Custom
4242
4343Extra-source-files: lib/Makefile lib/*.idr lib/prelude/*.idr lib/network/*.idr
44− tutorial/examples/*.idr
44+ lib/control/monad/*.idr tutorial/examples/*.idr
4545
4646source-repository head
4747 type: git
tutorial/classes.tex+7−5
@@ -53,6 +53,7 @@ Idris> show (S (S (S O)))
5353\useverb{shownat}
5454
5555\noindent
56+Only one instance of a class can be given for a type --- instances may not overlap.
5657Instance declarations can themselves have constraints. For example, to define a
5758\texttt{Show} instance for vectors, we need to know that there is a \texttt{Show}
5859instance for the element type, because we are going to use it to convert each element
@@ -71,11 +72,12 @@ instance Show a => Show (Vect a n) where
7172\useverb{showvec}
7273
7374\noindent
74−\textbf{Remark: } The type of the auxiliary function \texttt{show'} is important. The type
75−variables \texttt{a} and \texttt{n} which are part of the instance declaration for
76−\texttt{Show (Vect a n)} are fixed across the entire instance declaration. As a result,
77−we do not have to constrain \texttt{a} again. Furthermore, it means that if we use
78−\texttt{n} in the type, it refers to the length of the outermost list \texttt{xs}. Therefore,
75+\textbf{Remark: } The type of the auxiliary function \texttt{show'} is
76+important. The type variables \texttt{a} and \texttt{n} which are part of the
77+instance declaration for \texttt{Show (Vect a n)} are fixed across the entire
78+instance declaration. As a result, we do not have to constrain \texttt{a}
79+again. Furthermore, it means that if we use \texttt{n} in the type, it refers
80+to the (fixed) length of the outermost list \texttt{xs}. Therefore,
7981we use a different name for the length \texttt{n'} in \texttt{show'}.
8082
8183\subsection{Default Definitions}
tutorial/idris-tutorial.pdf

Binary file not shown.