Commit graph

22497 commits

Author SHA1 Message Date
Leonardo de Moura
8d032abcd5 chore: update stage0 2020-11-20 14:01:12 -08:00
Leonardo de Moura
27e26998d2 chore: prepare to change structInst syntax 2020-11-20 13:57:52 -08:00
Leonardo de Moura
bb6945d384 chore: update stage0 2020-11-20 12:37:12 -08:00
Leonardo de Moura
72032980ff feat: support for unboundImplicitLocals at variable and variables commands
They are morally part of the header.

cc @Kha
2020-11-20 12:32:32 -08:00
Leonardo de Moura
f3779f1542 feat: add support for unbound implicit locals 2020-11-20 12:22:27 -08:00
Leonardo de Moura
5adfd37dfd feat: add auxiliary KVMap for storing extra information at Exception.internal 2020-11-20 09:49:00 -08:00
Leonardo de Moura
2a769bbd79 feat: add missing keywords 2020-11-20 09:45:36 -08:00
Sebastian Ullrich
f6943d9c13 doc: fix highlighting of #eval etc. 2020-11-20 16:59:23 +01:00
Sebastian Ullrich
1e2c0d1d41 doc: remove "section" keywords, which aren't highlighted 2020-11-20 16:59:23 +01:00
Sebastian Ullrich
23bedc5ef5 doc: inline un-minified highlightjs-lean code into highlight.js 2020-11-20 16:59:23 +01:00
Leonardo de Moura
40ab77288d fix: namespaces.md 2020-11-20 07:56:53 -08:00
Leonardo de Moura
eba78e2d83 test: renaming for intrinsically typed lambda calculus 2020-11-19 19:10:49 -08:00
Leonardo de Moura
594c5a52f6 fix: sections.md 2020-11-19 19:06:06 -08:00
Leonardo de Moura
5fe11e0f00 doc: move example to tour.md 2020-11-19 17:38:51 -08:00
Leonardo de Moura
b619f09010 doc: section, variables and namespaces 2020-11-19 17:34:08 -08:00
Leonardo de Moura
3323f7da60 feat: add instance Inhabited (Sort u) 2020-11-19 13:55:00 -08:00
Leonardo de Moura
e29cc367f3 feat: test each example using a separate file 2020-11-19 13:51:52 -08:00
Leonardo de Moura
72a6ce498a chore: move lean3changes.md 2020-11-19 12:57:41 -08:00
Leonardo de Moura
a1c52ae1c4 doc: expand functions.md 2020-11-19 12:48:51 -08:00
Leonardo de Moura
918420744e feat: add whatIsLean.md 2020-11-19 11:33:13 -08:00
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