@@ -371,42 +371,42 @@ Non-backwards compatible changes
371
371
` m / n ` without having to explicitly provide a proof, as instance search will fill it in
372
372
for you. The full list of such operations changed is as follows:
373
373
- In ` Data.Nat.DivMod ` : ` _/_ ` , ` _%_ ` , ` _div_ ` , ` _mod_ `
374
- - In `Data.Nat.Pseudorandom.LCG`: `Generator`
375
- - In `Data.Integer.DivMod`: `_divℕ_`, `_div_`, `_modℕ_`, `_mod_`
376
- - In `Data.Rational`: `mkℚ+`, `normalize`, `_/_`, `1/_`
377
- - In `Data.Rational.Unnormalised`: `_/_`, `1/_`, `_÷_`
374
+ - In ` Data.Nat.Pseudorandom.LCG ` : ` Generator `
375
+ - In ` Data.Integer.DivMod ` : ` _divℕ_ ` , ` _div_ ` , ` _modℕ_ ` , ` _mod_ `
376
+ - In ` Data.Rational ` : ` mkℚ+ ` , ` normalize ` , ` _/_ ` , ` 1/_ `
377
+ - In ` Data.Rational.Unnormalised ` : ` _/_ ` , ` 1/_ ` , ` _÷_ `
378
378
379
379
* At the moment, there are 4 different ways such instance arguments can be provided,
380
380
listed in order of convenience and clarity:
381
381
1 . * Automatic basic instances* - the standard library provides instances based on the constructors of each
382
- numeric type in `Data.X.Base`. For example, `Data.Nat.Base` constains an instance of `NonZero (suc n)` for any `n`
383
- and `Data.Integer.Base` contains an instance of `NonNegative (+ n)` for any `n`. Consequently,
384
- if the argument is of the required form, these instances will always be filled in by instance search
385
- automatically, e.g.
386
- ```
387
- 0/n≡0 : 0 / suc n ≡ 0
388
- ```
389
- 2. *Take the instance as an argument* - You can provide the instance argument as a parameter to your function
390
- and Agda's instance search will automatically use it in the correct place without you having to
391
- explicitly pass it, e.g.
392
- ```
393
- 0/n≡0 : .{{_ : NonZero n}} → 0 / n ≡ 0
394
- ```
395
- 3. *Define the instance locally* - You can define an instance argument in scope (e.g. in a `where` clause)
396
- and Agda's instance search will again find it automatically, e.g.
397
- ```
398
- instance
399
- n≢0 : NonZero n
400
- n≢0 = ...
401
-
402
- 0/n≡0 : 0 / n ≡ 0
403
- ```
404
- 4. *Pass the instance argument explicitly* - Finally, if all else fails you can pass the
405
- instance argument explicitly into the function using `{{ }}`, e.g.
406
- ```
407
- 0/n≡0 : ∀ n (n≢0 : NonZero n) → ((0 / n) {{n≢0}}) ≡ 0
408
- ```
409
- Suitable constructors for `NonZero`/`Positive` etc. can be found in `Data.X.Base`.
382
+ numeric type in ` Data.X.Base ` . For example, ` Data.Nat.Base ` constains an instance of ` NonZero (suc n) ` for any ` n `
383
+ and ` Data.Integer.Base ` contains an instance of ` NonNegative (+ n) ` for any ` n ` . Consequently,
384
+ if the argument is of the required form, these instances will always be filled in by instance search
385
+ automatically, e.g.
386
+ ```
387
+ 0/n≡0 : 0 / suc n ≡ 0
388
+ ```
389
+ 2. *Take the instance as an argument* - You can provide the instance argument as a parameter to your function
390
+ and Agda's instance search will automatically use it in the correct place without you having to
391
+ explicitly pass it, e.g.
392
+ ```
393
+ 0/n≡0 : .{{_ : NonZero n}} → 0 / n ≡ 0
394
+ ```
395
+ 3. *Define the instance locally* - You can define an instance argument in scope (e.g. in a `where` clause)
396
+ and Agda's instance search will again find it automatically, e.g.
397
+ ```
398
+ instance
399
+ n≢0 : NonZero n
400
+ n≢0 = ...
401
+
402
+ 0/n≡0 : 0 / n ≡ 0
403
+ ```
404
+ 4. *Pass the instance argument explicitly* - Finally, if all else fails you can pass the
405
+ instance argument explicitly into the function using `{{ }}`, e.g.
406
+ ```
407
+ 0/n≡0 : ∀ n (n≢0 : NonZero n) → ((0 / n) {{n≢0}}) ≡ 0
408
+ ```
409
+ Suitable constructors for `NonZero`/`Positive` etc. can be found in `Data.X.Base`.
410
410
411
411
* A full list of proofs that have changed to use instance arguments is available at the end of this file.
412
412
Notable changes to proofs are now discussed below.
@@ -457,14 +457,14 @@ Non-backwards compatible changes
457
457
* As a consequence of this, some proofs that relied on this reduction behaviour
458
458
or on eta-equality may no longer go through. There are several ways to fix this:
459
459
1. The principled way is to not rely on this reduction behaviour in the first place.
460
- The `Properties` files for rational numbers have been greatly expanded in `v1.7`
461
- and `v2.0`, and we believe most proofs should be able to be built up from existing
462
- proofs contained within these files.
460
+ The `Properties` files for rational numbers have been greatly expanded in `v1.7`
461
+ and `v2.0`, and we believe most proofs should be able to be built up from existing
462
+ proofs contained within these files.
463
463
2. Alternatively, annotating any rational arguments to a proof with either
464
- `@record{}` or `@(mkℚ _ _ _)` should restore the old reduction behaviour for any
465
- terms involving those parameters.
464
+ `@record{}` or `@(mkℚ _ _ _)` should restore the old reduction behaviour for any
465
+ terms involving those parameters.
466
466
3. Finally, if the above approaches are not viable then you may be forced to explicitly
467
- use `cong` combined with a lemma that proves the old reduction behaviour.
467
+ use `cong` combined with a lemma that proves the old reduction behaviour.
468
468
469
469
### Change to the definition of `LeftCancellative` and `RightCancellative`
470
470
@@ -478,20 +478,20 @@ Non-backwards compatible changes
478
478
479
479
* Therefore the definitions have been changed as follows to make all their arguments explicit:
480
480
- `LeftCancellative _•_`
481
- - From: `∀ x {y z} → (x • y) ≈ (x • z) → y ≈ z`
482
- - To: `∀ x y z → (x • y) ≈ (x • z) → y ≈ z`
481
+ - From: `∀ x {y z} → (x • y) ≈ (x • z) → y ≈ z`
482
+ - To: `∀ x y z → (x • y) ≈ (x • z) → y ≈ z`
483
483
484
484
- `RightCancellative _•_`
485
485
- From: `∀ {x} y z → (y • x) ≈ (z • x) → y ≈ z`
486
- - To: `∀ x y z → (y • x) ≈ (z • x) → y ≈ z`
486
+ - To: `∀ x y z → (y • x) ≈ (z • x) → y ≈ z`
487
487
488
488
- `AlmostLeftCancellative e _•_`
489
489
- From: `∀ {x} y z → ¬ x ≈ e → (x • y) ≈ (x • z) → y ≈ z`
490
- - To: `∀ x y z → ¬ x ≈ e → (x • y) ≈ (x • z) → y ≈ z`
490
+ - To: `∀ x y z → ¬ x ≈ e → (x • y) ≈ (x • z) → y ≈ z`
491
491
492
492
- `AlmostRightCancellative e _•_`
493
- - From: `∀ {x} y z → ¬ x ≈ e → (y • x) ≈ (z • x) → y ≈ z`
494
- - To: `∀ x y z → ¬ x ≈ e → (y • x) ≈ (z • x) → y ≈ z`
493
+ - From: `∀ {x} y z → ¬ x ≈ e → (y • x) ≈ (z • x) → y ≈ z`
494
+ - To: `∀ x y z → ¬ x ≈ e → (y • x) ≈ (z • x) → y ≈ z`
495
495
496
496
* Correspondingly some proofs of the above types will need additional arguments passed explicitly.
497
497
Instances can easily be fixed by adding additional underscores, e.g.
@@ -643,7 +643,7 @@ Non-backwards compatible changes
643
643
- `¬?` has been moved from `Relation.Nullary.Negation.Core` to `Relation.Nullary.Decidable.Core`
644
644
- `¬-reflects` has been moved from `Relation.Nullary.Negation.Core` to `Relation.Nullary.Reflects`.
645
645
- `decidable-stable`, `excluded-middle` and `¬-drop-Dec` have been moved from `Relation.Nullary.Negation`
646
- to `Relation.Nullary.Decidable`.
646
+ to `Relation.Nullary.Decidable`.
647
647
- `fromDec` and `toDec` have been mvoed from `Data.Sum.Base` to `Data.Sum`.
648
648
649
649
### Refactoring of the unindexed Functor/Applicative/Monad hiearchy
@@ -883,13 +883,13 @@ Major improvements
883
883
884
884
* The ring solver tactic has been greatly improved. In particular:
885
885
1. When the solver is used for concrete ring types, e.g. ℤ, the equality can now use
886
- all the ring operations defined natively for that type, rather than having
887
- to use the operations defined in `AlmostCommutativeRing`. For example
888
- previously you could not use `Data.Integer.Base._*_` but instead had to
889
- use `AlmostCommutativeRing._*_`.
886
+ all the ring operations defined natively for that type, rather than having
887
+ to use the operations defined in `AlmostCommutativeRing`. For example
888
+ previously you could not use `Data.Integer.Base._*_` but instead had to
889
+ use `AlmostCommutativeRing._*_`.
890
890
2. The solver now supports use of the subtraction operator `_-_` whenever
891
891
it is defined immediately in terms of `_+_` and `-_`. This is the case for
892
- `Data.Integer` and `Data.Rational`.
892
+ `Data.Integer` and `Data.Rational`.
893
893
894
894
### Moved `_%_` and `_/_` operators to `Data.Nat.Base`
895
895
0 commit comments