chore: fix a typo in the docstring for SeqRight and add documentation to getLevel (#10866)
This commit is contained in:
parent
916125ae1c
commit
2eb44b3cdc
2 changed files with 7 additions and 1 deletions
|
|
@ -3703,7 +3703,7 @@ When thinking about `f` as potential side effects, `*>` evaluates first the left
|
|||
argument for their side effects, discarding the value of the left argument and returning the value
|
||||
of the right argument.
|
||||
|
||||
For most applications, `Applicative` or `Monad` should be used rather than `SeqLeft` itself.
|
||||
For most applications, `Applicative` or `Monad` should be used rather than `SeqRight` itself.
|
||||
-/
|
||||
class SeqRight (f : Type u → Type v) : Type (max (u+1) v) where
|
||||
/--
|
||||
|
|
|
|||
|
|
@ -129,6 +129,12 @@ private def inferProjType (structName : Name) (idx : Nat) (e : Expr) : MetaM Exp
|
|||
def throwTypeExpected {α} (type : Expr) : MetaM α :=
|
||||
throwError "type expected{indentExpr type}"
|
||||
|
||||
/--
|
||||
If `type : sort` and `sort` reduces to `Sort u` for some `u`, then `getLevel type` returns `u`.
|
||||
|
||||
If `sort` is an assignable MVar, then `getLevel type` produces a fresh level metavariable `?u`,
|
||||
assigns the MVar to `Sort ?u` and returns `?u`.
|
||||
-/
|
||||
def getLevel (type : Expr) : MetaM Level := do
|
||||
let typeType ← inferType type
|
||||
let typeType ← whnfD typeType
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue