Commit graph

16 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
9482976345 test: speed up some tests for the debug interpreter 2019-12-07 21:51:59 +01: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
Sebastian Ullrich
c299e6c0e6 chore(tests): fix do syntax in tests 2019-06-30 13:04:34 +02:00
Leonardo de Moura
e71249f6b3 chore(tests): fix tests 2019-03-27 14:06:23 -07:00
Sebastian Ullrich
f34d37c371 chore(tests): port tests, fix at least compiler tests 2019-03-21 15:11:05 -07:00
Leonardo de Moura
6d0ec3a8c9 refactor(library/init/io): implement io monad using estate monad 2019-03-16 15:34:58 -07:00
Sebastian Ullrich
03456ab752 chore(tests/compiler/t2): fix test 2019-02-15 12:13:45 -08:00
Leonardo de Moura
b6d1506434 fix(tests/compiler/t2): pause at the end
@kha I figured out why we had a long pause in the end of this benchmark
when using `11` instead of `9`. The function `deriv` was computing
`d := d "x" f` (the expensive computation), printing the size of `f` and
returning `d`. So, in the last step we were quickly printing the size
of the input 40230090 (when using `nest deriv 11 f`), and then computing
`d := d "x" f` which returns an object of size 374429936 which is never
used for anything.
That is, the pause had nothing to do with memory deallocation. I found
this issue after I implemented the deferred free feature which did not
fix the pause :)
2019-02-14 10:44:59 -08:00
Leonardo de Moura
e2ee2d4bd9 chore(tests/compiler): add deriv test 2019-02-07 16:56:40 -08:00