lean4-htt/tests/lean
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
..
run refactor: remove MonadIO 2020-11-18 18:47:22 -08:00
server chore: fix tests 2020-10-25 09:11:13 -07:00
trust0 chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
.gitignore
217.lean fix: fixes #217 2020-11-12 14:36:47 -08:00
217.lean.expected.out fix: fixes #217 2020-11-12 14:36:47 -08:00
abst.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
abst.lean.expected.out
appParserIssue.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
appParserIssue.lean.expected.out
attrCmd.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
attrCmd.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
auxDeclIssue.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
auxDeclIssue.lean.expected.out
binsearch.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
binsearch.lean.expected.out
bytearray.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
bytearray.lean.expected.out
class_def_must_fail.lean chore: fix tests 2020-10-25 09:11:13 -07:00
class_def_must_fail.lean.expected.out chore: fix tests 2020-10-25 09:11:13 -07:00
classBadOutParam.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
classBadOutParam.lean.expected.out
collectDepsIssue.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
collectDepsIssue.lean.expected.out
ctor_layout.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
ctor_layout.lean.expected.out
dbgMacros.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
dbgMacros.lean.expected.out chore: fix tests 2020-10-05 11:28:52 -07:00
doNotation1.lean feat: only allow variables declared with mut to be reassigned 2020-11-07 17:32:13 -08:00
doNotation1.lean.expected.out feat: only allow variables declared with mut to be reassigned 2020-11-07 17:32:13 -08:00
doSeqRightIssue.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
doSeqRightIssue.lean.expected.out
emptyc.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
emptyc.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
envExtensionSealed.lean chore: move to new frontend 2020-10-21 13:30:43 -07:00
envExtensionSealed.lean.expected.out chore: move to new frontend 2020-10-21 13:30:43 -07:00
eval_except.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
eval_except.lean.expected.out
evalWithMVar.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
evalWithMVar.lean.expected.out feat: improve error messages for unassigned metavariables 2020-09-29 17:18:03 -07:00
exitAfterParseError.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
exitAfterParseError.lean.expected.out fix: skip minimum amount of tokens during parser recovery 2020-09-21 11:37:50 +02:00
extract.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
extract.lean.expected.out
file_not_found.lean chore: remove dead files and functions 2020-11-10 18:37:15 -08:00
file_not_found.lean.expected.out
Format.lean chore: move to new frontend 2020-10-21 16:35:50 -07:00
Format.lean.expected.out feat: Format.fill 2020-10-07 15:30:36 +02:00
funExpected.lean feat: improve function expected error message 2020-10-23 06:52:51 -07:00
funExpected.lean.expected.out feat: improve function expected error message 2020-10-23 06:52:51 -07:00
holeErrors.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
holeErrors.lean.expected.out feat: hide auxiliary metavariables used to compile let-rec 2020-10-30 14:58:17 -07:00
holes.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
holes.lean.expected.out refactor: elabAppArgsAux 2020-10-11 15:08:12 -07:00
hygienicIntro.lean chore: remove unnecessary with at induction/cases tactics 2020-11-02 13:30:54 -08:00
hygienicIntro.lean.expected.out feat: add hygienicIntro option 2020-09-18 13:02:38 -07:00
inductionErrors.lean feat: support for _ and ?hole at all induction/cases variants 2020-11-03 17:20:53 -08:00
inductionErrors.lean.expected.out feat: support for _ and ?hole at all induction/cases variants 2020-11-03 17:20:53 -08:00
inductive1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
inductive1.lean.expected.out chore: move to new frontend 2020-10-16 09:16:33 -07:00
infoFromFailure.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
infoFromFailure.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
inst.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
inst.lean.expected.out
invalidNamedArgs.lean feat: improve invalid named argument error message 2020-10-23 06:47:07 -07:00
invalidNamedArgs.lean.expected.out feat: improve invalid named argument error message 2020-10-23 06:47:07 -07:00
IRbug.lean chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
IRbug.lean.expected.out
json.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
json.lean.expected.out
letrec1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
letrec1.lean.expected.out
letrecErrors.lean fix: registerLetRecsToLift 2020-11-18 18:47:22 -08:00
letrecErrors.lean.expected.out fix: registerLetRecsToLift 2020-11-18 18:47:22 -08:00
ll_infer_type_bug.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
ll_infer_type_bug.lean.expected.out chore: fix tests 2020-10-25 09:11:13 -07:00
lvl1.lean chore: cleanup src/Array/Basic.lean 2020-10-28 19:35:42 -07:00
lvl1.lean.expected.out
macroPrio.lean feat: allow user to assign parsing priorities in the macro and elab commands 2020-10-29 20:33:51 -07:00
macroPrio.lean.expected.out feat: allow user to assign parsing priorities in the macro and elab commands 2020-10-29 20:33:51 -07:00
macroscopes.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
macroscopes.lean.expected.out
macroStack.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
macroStack.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
match1.lean fix: don't try to pretty-print underapplied matcher 2020-11-14 13:19:21 +01:00
match1.lean.expected.out fix: don't try to pretty-print underapplied matcher 2020-11-14 13:19:21 +01:00
match2.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
match2.lean.expected.out
match3.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
match3.lean.expected.out
match4.lean refactor: use Lists for Array reference implementation 2020-11-17 17:05:53 -08:00
match4.lean.expected.out
matchErrorLocation.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
matchErrorLocation.lean.expected.out chore: suppress extraMsg in type mismatch errors 2020-10-06 10:58:50 -07:00
mutualdef1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
mutualdef1.lean.expected.out
mutualWithNamespaceMacro.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
mutualWithNamespaceMacro.lean.expected.out
mvar1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
mvar1.lean.expected.out
mvar2.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
mvar2.lean.expected.out
mvar3.lean chore: fix tests 2020-11-11 10:19:14 -08:00
mvar3.lean.expected.out
mvar_fvar.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
mvar_fvar.lean.expected.out
namedHoles.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
namedHoles.lean.expected.out chore: suppress extraMsg in type mismatch errors 2020-10-06 10:58:50 -07:00
namelit.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
namelit.lean.expected.out chore: fix tests 2020-11-11 10:19:14 -08:00
nonReserved.lean fix: notation for non reserved symbols 2020-11-17 11:25:04 -08:00
nonReserved.lean.expected.out feat: add support for nonReservedSymbol at syntax command 2020-11-12 07:32:18 -08:00
openExport.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
openExport.lean.expected.out
parserPrio.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
parserPrio.lean.expected.out feat: pretty print lists and arrays 2020-11-10 10:11:24 -08:00
phashmap_inst_coherence.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
phashmap_inst_coherence.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
ppExpr.lean refactor: remove MonadIO 2020-11-18 18:47:22 -08:00
ppExpr.lean.expected.out feat: delaborator: apply pp options from Expr.mdata nodes 2020-11-03 12:36:33 +01:00
PPRoundtrip.lean chore: remove dead files and functions 2020-11-10 18:37:15 -08:00
PPRoundtrip.lean.expected.out fix: double indentation inside parentheses 2020-10-30 19:10:08 +01:00
ppSyntax.lean refactor: remove MonadIO 2020-11-18 18:47:22 -08:00
ppSyntax.lean.expected.out fix: fix pretty printers for imported ParserDescrs 2020-11-07 17:05:07 +01:00
precissues.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
precissues.lean.expected.out fix: break grouped fill items containing hard line breaks 2020-10-14 14:24:47 +02:00
private.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
private.lean.expected.out
Process.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
Process.lean.expected.out fix: IO.Process.output 2020-09-29 08:01:10 -07:00
protected.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
protected.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
readlinkf.sh
ref1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
ref1.lean.expected.out
Reformat.lean.expected.out chore: fix test 2020-11-11 07:18:49 -08:00
repr_issue.lean chore: HasRepr ==> Repr 2020-10-27 16:15:10 -07:00
repr_issue.lean.expected.out
resolveGlobalName.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
resolveGlobalName.lean.expected.out feat: add resolveGlobalConst and resolveGlobalConstNoOverload 2020-09-20 08:54:24 -07:00
rewrite.lean fix: missing do 2020-10-30 18:15:37 -07:00
rewrite.lean.expected.out feat: pretty print lists and arrays 2020-11-10 10:11:24 -08:00
sanitizeMacroScopes.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
sanitizeMacroScopes.lean.expected.out chore: add Elab.command trace class 2020-10-18 16:35:08 -07:00
shadow.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
shadow.lean.expected.out chore: suppress extraMsg in type mismatch errors 2020-10-06 10:58:50 -07:00
smartUnfolding.lean test: smart unfolding 2020-11-15 16:36:22 -08:00
smartUnfolding.lean.expected.out test: smart unfolding 2020-11-15 16:36:22 -08:00
stdio.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
stdio.lean.expected.out
string_imp.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
string_imp.lean.expected.out
string_imp2.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
string_imp2.lean.expected.out
struct1.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
struct1.lean.expected.out chore: suppress extraMsg in type mismatch errors 2020-10-06 10:58:50 -07:00
StxQuot.lean chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
StxQuot.lean.expected.out chore: fix tests 2020-11-11 19:09:23 -08:00
syntaxErrors.lean feat: improve error messages for syntax command 2020-11-17 10:33:53 -08:00
syntaxErrors.lean.expected.out feat: improve error messages for syntax command 2020-11-17 10:33:53 -08:00
syntaxInNamespacesAndPP.lean fix: SyntaxNodeKind for syntax declarations nested in namespaces 2020-11-05 15:31:50 -08:00
syntaxInNamespacesAndPP.lean.expected.out chore: fix tests 2020-11-11 19:09:23 -08:00
test_single.sh
typeMismatch.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
typeMismatch.lean.expected.out refactor: remove MonadIO 2020-11-18 18:47:22 -08:00
typeOf.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
typeOf.lean.expected.out chore: avoid Has prefix in type classes 2020-10-27 18:29:19 -07:00
uintCtors.lean fix: UInt ctors/fields in generated code 2020-11-14 12:50:32 -08:00
uintCtors.lean.expected.out fix: UInt ctors/fields in generated code 2020-11-14 12:50:32 -08:00
univInference.lean fix: improve structure/inductive commands universe level inference and validation 2020-10-25 05:46:51 -07:00
univInference.lean.expected.out fix: improve structure/inductive commands universe level inference and validation 2020-10-25 05:46:51 -07:00
unknownTactic.lean feat: better error message for "unknown" tactic 2020-10-30 14:58:17 -07:00
unknownTactic.lean.expected.out feat: better error message for "unknown" tactic 2020-10-30 14:58:17 -07:00
unsolvedIndCases.lean fix: error position for unsolved goals at cases and induction tactics 2020-11-13 07:59:50 -08:00
unsolvedIndCases.lean.expected.out fix: error position for unsolved goals at cases and induction tactics 2020-11-13 07:59:50 -08:00
unused_univ.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
unused_univ.lean.expected.out
zipper.lean chore: remove new_frontend from tests 2020-10-25 09:16:38 -07:00
zipper.lean.expected.out