Commit graph

61 commits

Author SHA1 Message Date
Sebastian Ullrich
428355cf02
chore: remove redundant imports in core (#10750) 2025-10-16 20:27:46 +00:00
Sebastian Ullrich
e5730e9b7e
refactor: module-ize remainder of Std (#9195) 2025-07-17 11:43:57 +00:00
Sebastian Ullrich
09a5b34931
feat: make private the default in module (#9044)
This PR adjusts the experimental module system to make `private` the
default visibility modifier in `module`s, introducing `public` as a new
modifier instead. `public section` can be used to revert the default for
an entire section, though this is more intended to ease gradual adoption
of the new semantics such as in `Init` (and soon `Std`) where they
should be replaced by a future decl-by-decl re-review of visibilities.
2025-06-28 16:30:53 +00:00
Joachim Breitner
803dc3e687
refactor: Init: expose lots of functions (#8501)
This PR adds the `@[expose]` attribute to many functions (and changes
some theorems to be by `:= (rfl)`) in preparation for the `@[defeq]`
attribute change in #8419.
2025-05-28 07:37:54 +00:00
Sebastian Ullrich
01dbbeed99
feat: do not export def bodies by default (#8221)
This PR adjusts the experimental module system to not export the bodies
of `def`s unless opted out by the new attribute `@[expose]` on the `def`
or on a surrounding `section`.

---------

Co-authored-by: Markus Himmel <markus@lean-fro.org>
2025-05-15 12:16:54 +00:00
Sebastian Ullrich
7feb583b9e
feat: enable experimental module system in Init (#8047) 2025-04-23 17:21:33 +00:00
David Thrane Christiansen
b768e44ba7
doc: further missing docstrings (#7613)
This PR adds a variety of docstrings for names that appear in the
manual.
2025-03-21 22:20:07 +00:00
David Thrane Christiansen
06c57826ae
doc: manual docstring review for smaller namespaces (#7365)
This PR updates docstrings and adds some that are missing.
2025-03-13 16:09:37 +00:00
JovanGerb
c7c50a8bec
chore: fix linter errors (#4502)
The linters in Batteries can be used to spot mistakes in Lean. See the
message on
[Zulip](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Go-to-def.20on.20typeclass.20fields.20and.20type-dependent.20notation/near/442613564).
These are the different linters with errors:

- unusedArguments:
There are many unused instance arguments, especially a redundant `[Monad
m]` is very common
- checkUnivs:
There was a problem with universes in a definition in
`Init.Control.StateCps`. I fixed it by adding a `variable` statement for
the implicit arguments in the file.
- defLemma:
many proofs are written as `def` instead of `theorem`, most notably
`rfl`. Because `rfl` is used as a match pattern, it must be a def. Is
this desirable?
The keyword `abbrev` is sometimes used for an alias of a theorem, which
also results in a def. I would want to replace it with the `alias`
keyword to fix this, but it isn't available.
- dupNamespace:
I fixed some of these, but left `Tactic.Tactic` and `Parser.Parser` as
they are as these seem intended.
- unusedHaveSuffices:
  I cleaned up a few proofs with unused `have` or `suffices`
- explicitVarsOfIff:
  I didn't fix any of these, because that would be a breaking change.
- simpNF:
I didn't fix any of these, because I think that requires knowing the
intended simplification order.
2024-06-19 18:24:08 +00:00
Mario Carneiro
583e023314 chore: snake-case attributes (part 2) 2022-10-19 09:28:08 -07:00
Leonardo de Moura
870de844dc chore: annotate relevant monadic code with [alwaysInline]
TODO: after we delete old code generator, we should replace
`@[alwaysInline, inline]` with `@[alwaysInline]`.

Remainder: we want the old code generator to ignore `@[alwaysInline]`
annotations, in particular, the new ones on `instance` commands that
are actually annotations for the instance methods.
2022-10-12 19:48:02 -07:00
Ed Ayers
c3f58a7eab
feat: add a message if Lean 4 is called with the Lean 3 extension 2022-07-29 11:08:51 +00:00
Sebastian Ullrich
ae7b895f7a refactor: unname some unused variables 2022-06-07 16:37:45 -07:00
Ed Ayers
d8e2d58da7 doc: InfoTree code review
Co-authored-by: Wojciech Nawrocki <wjnawrocki+gh@protonmail.com>
2022-04-15 09:07:35 -07:00
E.W.Ayers
9598e39c82 doc: InfoTree docstrings 2022-04-15 09:04:26 -07:00
Leonardo de Moura
bac91b9b5b chore: remove arbitrary 2022-01-15 12:14:27 -08:00
Sebastian Ullrich
d8d7eba6c5 feat: liftExcept 2021-11-09 16:58:13 +01:00
Leonardo de Moura
4dbb3e6db1 fix: add workaround to prevent code explosion at deriving for FromJson
fixes #569
2021-08-05 06:58:07 -07:00
Leonardo de Moura
d77f335ff0 feat: add LawfulMonad instance for ExceptT 2021-02-20 17:01:27 -08:00
Sebastian Ullrich
187a614575 chore: make tryFinally a def 2021-02-17 12:04:20 +01:00
Leonardo de Moura
f57c184dbd chore: remove = true old workarounds
@Kha The old `= true` workarounds are not needed anymore, they were
due to another issue and are not related to yesterday's issue.
That is, the one exposed by the `ForIn` typeclass.
2021-02-05 13:48:03 -08:00
Sebastian Ullrich
0c91b3769e chore: replace variables in src/ 2021-01-22 14:36:05 +01:00
Leonardo de Moura
2e11c3bdff feat: dependencies 2020-12-18 11:21:30 -08:00
Leonardo de Moura
16003871e4 feat: add helper instance 2020-11-28 19:01:54 -08:00
Leonardo de Moura
0869f38de4 chore: update structure, class, inductive 2020-11-27 15:09:30 -08:00
Leonardo de Moura
f456e006dc chore: test instance ... where 2020-11-23 18:24:23 -08:00
Leonardo de Moura
e6215f7282 chore: remove some unnecessary commas 2020-11-20 15:47:27 -08:00
Leonardo de Moura
304c80d610 feat: use <| 2020-11-19 09:03:38 -08:00
Leonardo de Moura
6ab0be952c chore: merge src/Control files
Some of them were almost empty after the refactoring.
2020-11-10 18:47:23 -08:00
Leonardo de Moura
a8c791ecae chore: remove dead files and functions
Remove obsolete combinators: `whenM`, `unlessM`, and `condM`

cc @Kha
2020-11-10 18:37:15 -08:00
Leonardo de Moura
cca3bad0bb feat: add Prelude.lean
`Prelude.lean` has no dependencies, and
at the end of `Prelude`, the `syntax` and `macro` commands are operational.
2020-11-10 18:08:18 -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
5fed774461 chore: HasRepr ==> Repr 2020-10-27 16:15:10 -07:00
Leonardo de Moura
10c32fcf94 chore: HasToString => ToString 2020-10-27 16:11:48 -07:00
Leonardo de Moura
13c2a8ff51 chore: remove #lang lean4 header 2020-10-25 09:54:07 -07:00
Leonardo de Moura
7030dc91f2 chore: move to new frontend 2020-10-23 12:50:03 -07:00
Leonardo de Moura
a0b8f13094 chore: remove temporary def 2020-10-22 17:42:25 -07:00
Leonardo de Moura
d4a67baa8e refactor: rename MonadFinally.finally' => MonadFinally.tryFinally' 2020-10-22 17:40:30 -07:00
Leonardo de Moura
f1dd85e8a3 chore: remove temporary defs 2020-10-22 17:31:07 -07:00
Leonardo de Moura
02521397ac refactor: rename MonadExceptOf.catch => MonadExceptOf.tryCatch 2020-10-22 17:27:15 -07:00
Leonardo de Moura
a37e2ae46f refactor: simplify MonadFunctor 2020-10-22 17:05:34 -07:00
Leonardo de Moura
fa3c32d3b1 chore: remove adaptExcept 2020-10-22 16:56:23 -07:00
Leonardo de Moura
c865abb340 refactor: remove MonadRun 2020-10-22 16:30:06 -07:00
Leonardo de Moura
749e2063cf feat: add interpolated string for toString 2020-10-09 14:38:24 -07:00
Leonardo de Moura
5efa628e43 chore: split Lift.lean into MonadLift.lean, MonadFunctor.lean, and MonadRun.lean 2020-08-26 08:34:35 -07:00
Leonardo de Moura
321719b300 feat: add MonadFinally 2020-08-25 17:58:35 -07:00
Leonardo de Moura
1103806ff4 refactor: HasMonadLift ==> MonadLift 2020-08-25 13:54:41 -07:00
Leonardo de Moura
b03cd748cf feat: add MonadControl 2020-08-25 13:54:41 -07:00
Leonardo de Moura
916b395d1b chore: cleanup 2020-08-21 09:29:09 -07:00
Leonardo de Moura
6c234daad7 chore: MonadExceptCore => MonadExceptOf 2020-08-13 09:28:23 -07:00