After this commit, we have to use an explicit `discard` in code such as
```
def g (x : Nat) : IO Nat := ...
def f (x : Nat) : IO Unit := do
discard <| g x -- type error without the `discard`
IO.println x
```
Motivation: prevent users from making mistakes such as
```
def f (xs : Array Nat) : IO Unit := do
xs.set! 0 1
IO.println xs
```
when they meant to write
```
def f (xs : Array Nat) : IO Unit := do
let xs := xs.set! 0 1
IO.println xs
```
@Kha The motivation is to allow users to define default instances such as
```lean
@[defaultInstance 1]
instance : OfScientific Real where
...
```
Then, numerals such as `1.2` and `3.4e10` will be `Real` by default instead of `Float`.
Before this commit, the threshold was the amount of "fuel".
Now, it is the maximum number of instances used to solve a TC problem.
We have two thresholds
- `maxInstSize`: default 128
- `maxCoeSize`: default 16. It is similar to `maxInstSize`, but used for automatic coercions.
cc @Kha
@Kha It seems the new builtin antiquotation notation you added depends
on the array literal notation that is not builtin. I got the following
error after `update-stage0`
```
Lean/PrettyPrinter/Delaborator/Builtins.lean:455:2: error: elaboration function for '_kind.term._@.Init.Data.Array.Basic._hyg.3391' has not been implemented
```
The base name changed from `_kind.term` to `termKind`. I had to change
it because every parser we were defining was in the artificial (sub-)namespace
`_kind` :)
We didn't notive because we didn't have scoped parsers.
1) `ScopedEnvExtension` module now mananges the push/pop/activate
methods. Motivations:
- Easier to add attributes
- One `ScopedEnvExtension` may be shared between multiple
attributes (e.g., parsers)
2) Add `AttributeKind`
current limitations:
* don't work in patterns
* nested antiquotations must be of the form `$id`, not `$(e)`, and at most two of them
* sepBy antiquotation scopes hard-coded to `,`, `;`, `|` (e.g. `$[...],*`)
* unclear whether they can replace the old `$id:kind*` syntax yet
/cc @leodemoura