Commit graph

11 commits

Author SHA1 Message Date
Sebastian Ullrich
7e521f0105 chore: remove remaining #lang lean4 in tests 2021-01-27 14:45:31 +01:00
Leonardo de Moura
06ad52575a feat: force users to use discard when action result is not being bound and it is not PUnit
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
```
2020-12-08 06:14:48 -08:00
Leonardo de Moura
898a08a0c1 chore: avoid Has prefix in type classes
closes #203
2020-10-27 18:29:19 -07:00
Leonardo de Moura
10c32fcf94 chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
Leonardo de Moura
8cb1ff206c chore: move tests to new frontend 2020-10-23 14:07:26 -07:00
Sebastian Ullrich
8f67db0101 refactor: never implicitly ignore monadic results
Also change `do e; f` to desugar to `e *> f` so that it is affected as well
2020-04-23 11:09:59 -07:00
Sebastian Ullrich
3ed67138d5 chore(*): update equation syntax in files and old parser
for f in ../../**/*.lean; do echo $f; ./patch.lean.out $f > tmp && cat tmp > $f; done
2019-08-09 11:11:34 +02:00
Leonardo de Moura
40943f84f3 chore(tests): fix tests 2019-07-17 10:46:35 -07:00
Leonardo de Moura
a02443d23d chore(frontends/lean): fun x, e ==> fun x => e 2019-07-02 13:22:11 -07:00
Sebastian Ullrich
c299e6c0e6 chore(tests): fix do syntax in tests 2019-06-30 13:04:34 +02:00
Leonardo de Moura
4d2837430a fix(library/compiler/emit_cpp): tail call
Add temporary hack to fix `emit_tail_call`.
TODO: find a cleaner solution for the new IR compiler.
2019-05-21 23:07:10 -07:00