Commit graph

19742 commits

Author SHA1 Message Date
Sebastian Ullrich
fcdbdeecaf feat: delaborator: use implicit lambdas where possible
/cc @leodemoura it's not bullet-proof (unless `pp.explicit` is set), but let's
see if it is good enough in practice
2020-03-27 14:55:46 +01:00
Sebastian Ullrich
db93638a96 feat: delab forallE 2020-03-27 11:59:58 +01:00
Sebastian Ullrich
f39ea47376 chore: brackted ~> bracketed 2020-03-27 10:42:36 +01:00
Sebastian Ullrich
a79a2888d0 refactor: simplify delabLamAux 2020-03-27 10:42:36 +01:00
Leonardo de Moura
02acdee9ce feat: disable implicit lambda insertion for fun containing {} or []
cc @Kha
2020-03-26 14:32:12 -07:00
Leonardo de Moura
b4b5f2736f feat: elaborate [] and {} binder annotations in lambda abstractions
We can simulate Lean3 behavior.
2020-03-26 14:20:39 -07:00
Leonardo de Moura
cda2cdaa60 chore: update stage0 2020-03-26 14:16:00 -07:00
Leonardo de Moura
34ec66edb2 chore: re-enable {} and [] annotations at fun 2020-03-26 14:15:07 -07:00
Leonardo de Moura
07ffa535fe refactor: decide whether to insert implicit lambdas AFTER macro expansion
cc @Kha
2020-03-26 13:53:15 -07:00
Leonardo de Moura
2b3bdbe0cf test: implicit lambdas + notation 2020-03-26 12:31:04 -07:00
Leonardo de Moura
e682c1c88f fix: make sure @ disable new syntax and macros too
cc @Kha
2020-03-26 12:14:55 -07:00
Leonardo de Moura
0c5a08a16e chore: make sure Delaborator.lean still compiles
@Kha I removed `{}` `[]` from `funBinder`.
Please make sure `Delaborator.lean` still does what you want.
2020-03-26 10:40:16 -07:00
Leonardo de Moura
8c5ac07f81 chore: update stage0 2020-03-26 10:40:16 -07:00
Leonardo de Moura
19be2a5ade chore: remove {} and [] from funBinder 2020-03-26 10:40:16 -07:00
Leonardo de Moura
6625656940 refactor: remove support for fun {a : A} => ...
The semantics was weird. It seems Agda is also having problems with
it. Here is an example that demonstrates how weird the semantics is:

```lean
check (fun {β α} (a : α) (b : β) => (b, a) : {α : Type} → {β : Type} → (a : α) → (b : β) → β × α)

-- Same example using `def`
def f : {α : Type} → {β : Type} → α → β → β × α :=
fun {β : Type} {α : Type} (a : α) (b : β) => (b, a)
```

Both commands were being accepted before this commit. Note that it
flips `β` and `α`.

Here is an example that did not work before this commit and would
confuse users.

```lean
check
  let id := fun {α} (a : α) => a;
  id [id 1]
```

users would have to write

```lean
check
  let id {α} (a : α) := a;
  id [id 1]
```

@Kha The Delaborator.lean test broke and I "fixed" by removing the
`{}` from it, and copying `produced` over `expected`. Please make sure
it still makes sense.
2020-03-26 10:40:16 -07:00
Sebastian Ullrich
9be3abd721 doc: update lean4-mode readme 2020-03-26 11:24:01 +01:00
Leonardo de Moura
227f985f84 fix: bug at generalizeTelescope 2020-03-25 16:00:55 -07:00
Leonardo de Moura
d79cfa38e3 test: generalizeTelescope tests 2020-03-25 16:00:55 -07:00
Leonardo de Moura
08aa4db110 feat: add generalizeTelescope 2020-03-25 16:00:55 -07:00
Sebastian Ullrich
dda44bc47f doc: building Lean using Nix in WSL does work reasonably well 2020-03-25 14:24:49 +01:00
Sebastian Ullrich
b73dd0c9aa feat: run Emacs with lean4-mode directly from nix-shell 2020-03-25 12:47:00 +01:00
Sebastian Ullrich
1756d31694 chore: update build instructions 2020-03-25 12:45:52 +01:00
Sebastian Ullrich
6ffe310c48 feat: delab coercions 2020-03-24 17:27:10 +01:00
Sebastian Ullrich
3c71c4f0ea chore: fix benchmark 2020-03-24 17:27:02 +01:00
Sebastian Ullrich
fdc03c9d74 feat: delab projections 2020-03-24 17:27:02 +01:00
Leonardo de Moura
f62a40c06d chore: update stage0 2020-03-23 15:57:32 -07:00
Leonardo de Moura
098b0edbcb chore: remove dead code 2020-03-23 15:56:29 -07:00
Leonardo de Moura
2c12a073fa fix: missing file 2020-03-23 15:49:22 -07:00
Leonardo de Moura
2ca347fcd6 chore: fix test 2020-03-23 15:47:51 -07:00
Leonardo de Moura
2cc0f25bf5 feat: getLine at EOF should return empty string
This is the same approach used in Rust, and it simplifies the code.
2020-03-23 15:44:47 -07:00
Leonardo de Moura
bff734ec5b chore: update stage0 2020-03-23 14:54:13 -07:00
Leonardo de Moura
dc80b76106 feat: add IO.FS.lines 2020-03-23 14:53:27 -07:00
Leonardo de Moura
12c5075c67 fix: String.dropRight 2020-03-23 14:51:05 -07:00
Leonardo de Moura
41949ee801 refactor: String.toNat ==> String.toNat? and String.toNat! 2020-03-23 14:29:48 -07:00
Leonardo de Moura
94f016a3e8 fix: readLine and test 2020-03-23 14:06:17 -07:00
Leonardo de Moura
b2bddb5606 chore: style 2020-03-23 14:06:02 -07:00
Leonardo de Moura
e5601554f9 chore: update stage0 2020-03-23 12:26:58 -07:00
Leonardo de Moura
db914052ce fix: IO.getLine 2020-03-23 12:26:09 -07:00
Leonardo de Moura
2efc1855f0 fix: object may be a boxed scalar
Example: IOError.unexpectedEof
2020-03-23 12:14:32 -07:00
Leonardo de Moura
95c5ccc97d chore: update stage0 2020-03-23 11:58:58 -07:00
Leonardo de Moura
918256ff1f fix: we cannot export constants 2020-03-23 11:54:54 -07:00
Leonardo de Moura
4296e1d83e feat: add tests for Closure.lean 2020-03-20 18:32:04 -07:00
Leonardo de Moura
910cc33101 fix: missing lowerLooseBVars 2020-03-20 18:18:57 -07:00
Leonardo de Moura
b2901a9225 feat: add Closure.lean 2020-03-20 17:54:26 -07:00
Leonardo de Moura
b705142ae4 refactor: KernelException at MetaM 2020-03-20 17:54:26 -07:00
Leonardo de Moura
86784594d6 feat: add getFVars 2020-03-20 17:54:26 -07:00
Leonardo de Moura
11d6f91896 feat: add hasUnsafe 2020-03-20 17:54:26 -07:00
Sebastian Ullrich
a0e3f5f1c6 fix: delaborator positions 2020-03-20 16:50:47 +01:00
Sebastian Ullrich
b1d9e37d66 test: add re-elaborating delaborator PoC to playground 2020-03-19 17:18:46 -07:00
Sebastian Ullrich
e5f7334e2d chore: lean4-mode: operators are punctuation, '!' and '?' are symbol parts 2020-03-19 17:18:27 -07:00