Commit graph

36377 commits

Author SHA1 Message Date
Leonardo de Moura
90298ba476 feat: add helper instance 2020-11-19 11:32:54 -08:00
Leonardo de Moura
909969a7c2 chore: fix test 2020-11-19 09:25:13 -08:00
Leonardo de Moura
8a59fe5b52 feat: add ASCII version for · 2020-11-19 09:17:08 -08:00
Leonardo de Moura
d1b679b58f chore: update stage0 2020-11-19 09:16:56 -08:00
Leonardo de Moura
6551caf062 feat: define $ notation at Notation.lean 2020-11-19 09:10:19 -08:00
Leonardo de Moura
eb323f0c15 chore: update stage0 2020-11-19 09:06:51 -08:00
Leonardo de Moura
d7d53bf3a8 chore: remove builtin $
We will define it at `Notation.lean`
2020-11-19 09:04:41 -08:00
Leonardo de Moura
304c80d610 feat: use <| 2020-11-19 09:03:38 -08:00
Leonardo de Moura
b6a1914299 chore: remove $. notation
It has been replaced by `|>.`
2020-11-19 08:47:35 -08:00
Leonardo de Moura
f67c93191f feat: use |>. 2020-11-19 08:38:47 -08:00
Leonardo de Moura
998dd05c65 chore: update stage0 2020-11-19 08:28:52 -08:00
Leonardo de Moura
a58a7d6536 feat: expand |>. notation 2020-11-19 08:28:12 -08:00
Leonardo de Moura
4bd7cf2ca1 chore: update stage0 2020-11-19 08:16:07 -08:00
Leonardo de Moura
91b3e3e318 feat: add pipe proj notation
We will delete `dollarProj`
2020-11-19 08:14:29 -08:00
Leonardo de Moura
87d97c24a7 chore: code convention 2020-11-19 08:13:11 -08:00
Leonardo de Moura
954d850e6d feat: add F# pipe notation 2020-11-19 08:12:53 -08:00
Leonardo de Moura
28785bd8f1 chore: update stage0 2020-11-19 08:08:53 -08:00
Leonardo de Moura
5cc110dd77 feat: add Array.appendCore for quotations
We need it before we can define the more efficient `Array.append`
2020-11-19 08:07:53 -08:00
Leonardo de Moura
c305c2691f chore: use := 2020-11-19 07:22:31 -08:00
Leonardo de Moura
bd6265b484 chore: update stage0 2020-11-19 06:49:48 -08:00
Leonardo de Moura
0fcf6217ec feat: optional := before constructors in the inductive command
@Kha In the documentation, I will always use `:=`. The idea is to
avoid the issue: why does `structure` have a `:=` but `inductive`
doesn't.
2020-11-19 06:43:14 -08:00
Leonardo de Moura
7ccb996df5 doc: add tour.md 2020-11-18 19:06:21 -08:00
Leonardo de Moura
519922eaf4 doc: basic documentation 2020-11-18 18:47:22 -08:00
Leonardo de Moura
91dca53274 refactor: remove MonadIO
There is no reason for having `MonadIO` anymore. The `MonadLift` type
class is well behaved in the new frontend, the `MonadFinally` solves
the problem at monad stacks such as `ExcepT e IO`.

This commit also changes the type of the IO printing functions.
For example, the type of `IO.println` was
```
def IO.println {m} [MonadIO m] {α} [ToString α] (s : α) : m Unit
```
and now it is just
```
def IO.println {α} [ToString α] (s : α) : IO Unit
```
We rely on the new frontend auto-lifting feature.
That is, if there is an instance `[MonadLiftT IO m]`, then
a term of type `IO a` is automatically coerced to `m a`

We also want a simpler `IO.println` for writing tests.
For example,
```
```
doesn't work because there isn't sufficient information for inferring
the parameter `m` in the previous `IO.println`.
The shortest workaround looked very weird
```
```

I considered adding `IO` as a default value for `m` when we have
`MonadIO m`, as we use `Nat` as the default for `ofNat a`, but it felt
like uncessary complexity.

@Kha The commit seems to work well. The auto-lifting featuring has
been working great for me. There is still room for improvement.
For example, given `MonadLiftT m n`, it doesn't automatically lift
`a -> m b` into `a -> n b`. So, code such as
`foo >>= IO.println`
had to be rewritten as
`foo >>= fun x => IO.println x`
I will add this feature later.
If you have time, please try to play with this feature and figure out
if it is stable enough for making it the default.
That is, if it roboust enough, we can stop using the following idiom
for writing functions that can be lifted automatically.
```
def instantiateLevelMVarsImp (u : Level) : MetaM Level :=
  ...

def instantiateLevelMVars {m} [MonadLiftT MetaM m] (u : Level) : m Level :=
  liftMetaM $ instantiateLevelMVarsImp u
```
I think we only need this idiom when using `MonadControlT` which is
not as common as `MonadLiftT`.
2020-11-18 18:47:22 -08:00
Leonardo de Moura
bebca44773 feat: add println! macro for rewriting examples 2020-11-18 18:47:22 -08:00
Leonardo de Moura
e991f1993f feat: add Delta.lean 2020-11-18 18:47:22 -08:00
Leonardo de Moura
45cd9fe725 feat: add Core.transform 2020-11-18 18:47:22 -08:00
Leonardo de Moura
83deff4cde feat: add transform 2020-11-18 18:47:22 -08:00
Leonardo de Moura
590932584c chore: update stage0 2020-11-18 18:47:22 -08:00
Leonardo de Moura
a056332c03 fix: registerLetRecsToLift 2020-11-18 18:47:22 -08:00
Leonardo de Moura
35b193ebc0 chore: helper instances 2020-11-18 18:47:22 -08:00
Sebastian Ullrich
8c11905cd5 chore: update GitHub Actions actions 2020-11-18 12:05:21 +01:00
Leonardo de Moura
2c06ba577e chore: fix test 2020-11-17 17:14:06 -08:00
Leonardo de Moura
8ff204e067 chore: update stage0 2020-11-17 17:07:12 -08:00
Leonardo de Moura
7e533b4650 refactor: use Lists for Array reference implementation
Motivation: better reduction in the kernel.

cc @Kha
2020-11-17 17:05:53 -08:00
Leonardo de Moura
160a263049 chore: cleanup parsers 2020-11-17 14:29:32 -08:00
Leonardo de Moura
07149e6b75 chore: update stage0 2020-11-17 13:55:08 -08:00
Leonardo de Moura
df0e4808ec feat: define tactic parsers using syntax command 2020-11-17 13:52:36 -08:00
Leonardo de Moura
4da5cdb13d chore: declare tactic parsers using syntax command 2020-11-17 13:35:21 -08:00
Leonardo de Moura
c64cc0f662 chore: update stage0 2020-11-17 13:35:01 -08:00
Leonardo de Moura
a13c036181 chore: remove tactic builtin parsers 2020-11-17 13:34:05 -08:00
Leonardo de Moura
64669f4562 chore: refine heuristic for automatically marking the first symbol in tactic notation as non-reserved 2020-11-17 13:32:00 -08:00
Leonardo de Moura
4a9c69c7f5 chore: add parser alias matchDiscr 2020-11-17 13:31:56 -08:00
Leonardo de Moura
f17193e162 chore: update stage0 2020-11-17 11:49:53 -08:00
Leonardo de Moura
e737de3384 chore: cleanup induction/cases notation 2020-11-17 11:48:55 -08:00
Leonardo de Moura
8751bbe2a8 fix: notation for non reserved symbols 2020-11-17 11:25:04 -08:00
Leonardo de Moura
8fa5c0ddb9 chore: update stage0 2020-11-17 11:16:54 -08:00
Leonardo de Moura
3ad2d6c4e1 chore: add parser aliases 2020-11-17 11:15:17 -08:00
Leonardo de Moura
1d93eefada feat: add ! x notation for notFollowedBy(x) in the syntax command 2020-11-17 10:57:15 -08:00
Leonardo de Moura
f7dbfe6e1f chore: update stage0 2020-11-17 10:49:18 -08:00