The have
vs let
linter #
The have
vs let
linter flags uses of have
to introduce a hypothesis whose Type is not Prop
.
The option for this linter is a natural number, but really there are only 3 settings:
0
-- inactive;1
-- active only on noisy declarations;2
or more -- always active.
TODO:
- Also lint
let
vshave
. haveI
may need to change tolet/letI
?replace
,classical!
,classical
,tauto
internally usehave
: should the linter act on them as well?
The have
vs let
linter emits a warning on have
s introducing a hypothesis whose
Type is not Prop
.
There are three settings:
0
-- inactive;1
-- active only on noisy declarations;2
or more -- always active.
The default value is 1
.
find the have
syntax.
Equations
- Mathlib.Linter.haveLet.isHave? x = match x with | Lean.Syntax.node info `Lean.Parser.Tactic.tacticHave_ args => true | x => false
Instances For
a monadic version of Lean.Elab.InfoTree.foldInfo
.
Used to infer types inside a CommandElabM
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
given a ContextInfo
, a LocalContext
and an Array
of Expr
essions es
,
areProp_toFormat
creates a MetaM
context, and returns an array of pairs consisting of
- a
Bool
ean, answering the question of whether the Type ofe
is aProp
or not, and - the pretty-printed
Format
ofe
for eachExpr
essione
ines
. Concretely,areProp_toFormat
runsinferType
inCommandElabM
. This is the kind of monadic lift thatnonPropHaves
uses to decide whether the Type of ahave
is inProp
or not. The outputFormat
is just so that the linter displays a better message.
Equations
- One or more equations did not get rendered due to their size.
Instances For
returns the have
syntax whose corresponding hypothesis does not have Type Prop
and
also a Format
ted version of the corresponding Type.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The main implementation of the have
vs let
linter.
Equations
- One or more equations did not get rendered due to their size.