~ubuntu-branches/ubuntu/raring/agda/raring-proposed

« back to all changes in this revision

Viewing changes to doc/release-notes/2-2-6.txt

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-01-05 23:43:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100105234320-6ksc0sdsfhtweknu
Tags: 2.2.6-1
* New upstream release 2.2.6, for headlines please see:
  http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Main.Version-2-2-6
* debian/control
  + Bump standards-version to 3.8.3, no changes
  + Fix Vcs-Git to point to correct URL
  + Update build-depends for new upstream release
  + Undo arch/indep split per current pkg-haskell practice
  + Add Homepage field
* debian/copyright: Fix encoding to UTF-8 (thanks Lintian) 
* debian/README.source: Remove, no repacking so not necessary any more 
* debian/50agda.el:
  + Only load file if it exists, prevents a non-intrusive emacs warning
    where 50agda.el is left on system when package is removed. 
    (Closes: #559197). 
  + Do not load file on XEmacs — agda-mode is not compatible with XEmacs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
------------------------------------------------------------------------
 
2
-- Release notes for Agda 2 version 2.2.6
 
3
------------------------------------------------------------------------
 
4
 
 
5
Important changes since 2.2.4:
 
6
 
 
7
Language
 
8
--------
 
9
 
 
10
* Universe polymorphism (experimental extension).
 
11
 
 
12
  To enable universe polymorphism give the flag
 
13
  --universe-polymorphism on the command line or (recommended) as an
 
14
  OPTIONS pragma.
 
15
 
 
16
  When universe polymorphism is enabled Set takes an argument which is
 
17
  the universe level. For instance, the type of universe polymorphic
 
18
  identity is
 
19
 
 
20
    id : {a : Level} {A : Set a} → A → A.
 
21
 
 
22
  The type Level is isomorphic to the unary natural numbers and should be
 
23
  specified using the BUILTINs LEVEL, LEVELZERO, and LEVELSUC:
 
24
 
 
25
    data Level : Set where
 
26
      zero : Level
 
27
      suc  : Level → Level
 
28
 
 
29
    {-# BUILTIN LEVEL     Level #-}
 
30
    {-# BUILTIN LEVELZERO zero  #-}
 
31
    {-# BUILTIN LEVELSUC  suc   #-}
 
32
 
 
33
  There is an additional BUILTIN LEVELMAX for taking the maximum of two
 
34
  levels:
 
35
 
 
36
    max : Level → Level → Level
 
37
    max  zero    m      = m
 
38
    max (suc n)  zero   = suc n
 
39
    max (suc n) (suc m) = suc (max n m)
 
40
 
 
41
    {-# BUILTIN LEVELMAX max #-}
 
42
 
 
43
  The non-polymorphic universe levels Set, Set₁ and so on are sugar
 
44
  for Set zero, Set (suc zero), etc.
 
45
 
 
46
  At present there is no automatic lifting of types from one level to
 
47
  another. It can still be done (rather clumsily) by defining types
 
48
  like the following one:
 
49
 
 
50
    data Lifted {a} (A : Set a) : Set (suc a) where
 
51
      lift : A → Lifted A
 
52
 
 
53
  However, it is likely that automatic lifting is introduced at some
 
54
  point in the future.
 
55
 
 
56
* Multiple constructors, record fields, postulates or primitives can
 
57
  be declared using a single type signature:
 
58
 
 
59
    data Bool : Set where
 
60
      false true : Bool
 
61
 
 
62
    postulate
 
63
      A B : Set
 
64
 
 
65
* Record fields can be implicit:
 
66
 
 
67
    record R : Set₁ where
 
68
      field
 
69
        {A}         : Set
 
70
        f           : A → A
 
71
        {B C} D {E} : Set
 
72
        g           : B → C → E
 
73
 
 
74
  By default implicit fields are not printed.
 
75
 
 
76
* Record constructors can be defined:
 
77
 
 
78
    record Σ (A : Set) (B : A → Set) : Set where
 
79
      constructor _,_
 
80
      field
 
81
        proj₁ : A
 
82
        proj₂ : B proj₁
 
83
 
 
84
  In this example _,_ gets the type
 
85
 
 
86
     (proj₁ : A) → B proj₁ → Σ A B.
 
87
 
 
88
  For implicit fields the corresponding constructor arguments become
 
89
  implicit.
 
90
 
 
91
  Note that the constructor is defined in the /outer/ scope, so any
 
92
  fixity declaration has to be given outside the record definition.
 
93
  The constructor is not in scope inside the record module.
 
94
 
 
95
  Note also that pattern matching for records has not been implemented
 
96
  yet.
 
97
 
 
98
* BUILTIN hooks for equality.
 
99
 
 
100
  The data type
 
101
 
 
102
    data _≡_ {A : Set} (x : A) : A → Set where
 
103
      refl : x ≡ x
 
104
 
 
105
  can be specified as the builtin equality type using the following
 
106
  pragmas:
 
107
 
 
108
    {-# BUILTIN EQUALITY _≡_  #-}
 
109
    {-# BUILTIN REFL     refl #-}
 
110
 
 
111
  The builtin equality is used for the new rewrite construct and
 
112
  the primTrustMe primitive described below.
 
113
 
 
114
* New rewrite construct.
 
115
 
 
116
  If eqn : a ≡ b, where _≡_ is the builtin equality (see above) you
 
117
  can now write
 
118
 
 
119
    f ps rewrite eqn = rhs
 
120
 
 
121
  instead of
 
122
 
 
123
    f ps with a | eqn
 
124
    ... | ._ | refl = rhs
 
125
 
 
126
  The rewrite construct has the effect of rewriting the goal and the
 
127
  context by the given equation (left to right).
 
128
 
 
129
  You can rewrite using several equations (in sequence) by separating
 
130
  them with vertical bars (|):
 
131
 
 
132
    f ps rewrite eqn₁ | eqn₂ | … = rhs
 
133
 
 
134
  It is also possible to add with clauses after rewriting:
 
135
 
 
136
    f ps rewrite eqns with e
 
137
    ... | p = rhs
 
138
 
 
139
  Note that pattern matching happens before rewriting—if you want to
 
140
  rewrite and then do pattern matching you can use a with after the
 
141
  rewrite.
 
142
 
 
143
  See test/succeed/Rewrite.agda for some examples.
 
144
 
 
145
* A new primitive, primTrustMe, has been added:
 
146
 
 
147
    primTrustMe : {A : Set} {x y : A} → x ≡ y
 
148
 
 
149
  Here _≡_ is the builtin equality (see BUILTIN hooks for equality,
 
150
  above).
 
151
 
 
152
  If x and y are definitionally equal, then
 
153
  primTrustMe {x = x} {y = y} reduces to refl.
 
154
 
 
155
  Note that the compiler replaces all uses of primTrustMe with the
 
156
  REFL builtin, without any check for definitional equality. Incorrect
 
157
  uses of primTrustMe can potentially lead to segfaults or similar
 
158
  problems.
 
159
 
 
160
  For an example of the use of primTrustMe, see Data.String in version
 
161
  0.3 of the standard library, where it is used to implement decidable
 
162
  equality on strings using the primitive boolean equality.
 
163
 
 
164
* Changes to the syntax and semantics of IMPORT pragmas, which are
 
165
  used by the Haskell FFI. Such pragmas must now have the following
 
166
  form:
 
167
 
 
168
    {-# IMPORT <module name> #-}
 
169
 
 
170
  These pragmas are interpreted as /qualified/ imports, so Haskell
 
171
  names need to be given qualified (unless they come from the Haskell
 
172
  prelude).
 
173
 
 
174
* The horizontal tab character (U+0009) is no longer treated as white
 
175
  space.
 
176
 
 
177
* Line pragmas are no longer supported.
 
178
 
 
179
* The --include-path flag can no longer be used as a pragma.
 
180
 
 
181
* The experimental and incomplete support for proof irrelevance has
 
182
  been disabled.
 
183
 
 
184
Tools
 
185
-----
 
186
 
 
187
* New "intro" command in the Emacs mode. When there is a canonical way
 
188
  of building something of the goal type (for instance, if the goal
 
189
  type is a pair), the goal can be refined in this way. The command
 
190
  works for the following goal types:
 
191
 
 
192
    - A data type where only one of its constructors can be used to
 
193
      construct an element of the goal type. (For instance, if the
 
194
      goal is a non-empty vector, a "cons" will be introduced.)
 
195
 
 
196
    - A record type. A record value will be introduced. Implicit
 
197
      fields will not be included unless showing of implicit arguments
 
198
      is switched on.
 
199
 
 
200
    - A function type. A lambda binding as many variables as possible
 
201
      will be introduced. The variable names will be chosen from the
 
202
      goal type if its normal form is a dependent function type,
 
203
      otherwise they will be variations on "x". Implicit lambdas will
 
204
      only be inserted if showing of implicit arguments is switched
 
205
      on.
 
206
 
 
207
  This command can be invoked by using the refine command (C-c C-r)
 
208
  when the goal is empty. (The old behaviour of the refine command in
 
209
  this situation was to ask for an expression using the minibuffer.)
 
210
 
 
211
* The Emacs mode displays "Checked" in the mode line if the current
 
212
  file type checked successfully without any warnings.
 
213
 
 
214
* If a file F is loaded, and this file defines the module M, it is an
 
215
  error if F is not the file which defines M according to the include
 
216
  path.
 
217
 
 
218
  Note that the command-line tool and the Emacs mode define the
 
219
  meaning of relative include paths differently: the command-line tool
 
220
  interprets them relative to the current working directory, whereas
 
221
  the Emacs mode interprets them relative to the root directory of the
 
222
  current project. (As an example, if the module A.B.C is loaded from
 
223
  the file <some-path>/A/B/C.agda, then the root directory is
 
224
  <some-path>.)
 
225
 
 
226
* It is an error if there are several files on the include path which
 
227
  match a given module name.
 
228
 
 
229
* Interface files are relocatable. You can move around source trees as
 
230
  long as the include path is updated in a corresponding way. Note
 
231
  that a module M may be re-typechecked if its time stamp is strictly
 
232
  newer than that of the corresponding interface file (M.agdai).
 
233
 
 
234
* Type-checking is no longer done when an up-to-date interface exists.
 
235
  (Previously the initial module was always type-checked.)
 
236
 
 
237
* Syntax highlighting files for Emacs (.agda.el) are no longer used.
 
238
  The --emacs flag has been removed. (Syntax highlighting information
 
239
  is cached in the interface files.)
 
240
 
 
241
* The Agate and Alonzo compilers have been retired. The options
 
242
  --agate, --alonzo and --malonzo have been removed.
 
243
 
 
244
* The default directory for MAlonzo output is the project's root
 
245
  directory. The --malonzo-dir flag has been renamed to --compile-dir.
 
246
 
 
247
* Emacs mode: C-c C-x C-d no longer resets the type checking state.
 
248
  C-c C-x C-r can be used for a more complete reset. C-c C-x C-s
 
249
  (which used to reload the syntax highlighting information) has been
 
250
  removed. C-c C-l can be used instead.
 
251
 
 
252
* The Emacs mode used to define some "abbrevs", unless the user
 
253
  explicitly turned this feature off. The new default is /not/ to add
 
254
  any abbrevs. The old default can be obtained by customising
 
255
  agda2-mode-abbrevs-use-defaults (a customisation buffer can be
 
256
  obtained by typing M-x customize-group agda2 RET after an Agda file
 
257
  has been loaded).